Hi,
Need to implement callout using Callout Factory Plugin (ie. ICalloutFactory & ICalloutFromFactory method)
Callout should be defined on multiple columns of multiple table for example
a) Table C_Order and Columns 1) Document Type 2) Business Partner 3) Price List
b) Table C_Invoice and Columns 1) Document Type 2) Business Partner 3) Price List
c) Table M_Movement and and Columns 1) Document Type 2) Warehouse 3) To_Warehouse
d) Table M_Product and and Columns 1) Tax Category
Following are the two class created as per the wiki
http://wiki.idempiere.org/en/Developing_Plug-Ins_-_Callout=============================================================================================================================================
public class CattleyaCalloutFromFactory implements IColumnCallout {
public String start (Properties ctx, int WindowNo,
GridTab mTab, GridField mField, Object value, Object oldValue)
{
How to handle multiple different columns and tables here -????
=============================================================================================================================================
public class CattleyaCalloutFactory implements IColumnCalloutFactory {
/**
*
* @param tableName
* @param columnName
* @return array of matching callouts
*/
public IColumnCallout[] getColumnCallouts(String tableName, String columnName)
{
List<IColumnCallout> list = new ArrayList<IColumnCallout>();
if (tableName.equals(MMovement_CAT.Table_Name) && columnName.equals(MMovement_CAT.COLUMNNAME_M_Warehouse_ID))
list.add(new CattleyaCalloutFromFactory());
if (tableName.equals(MCOrder_CAT.Table_Name) && columnName.equals(MCOrder_CAT.COLUMNNAME_M_PriceList_ID))
list.add(new CattleyaCalloutFromFactory());
if (tableName.equals(MCInvoice_CAT.Table_Name) && columnName.equals(MCInvoice_CAT.COLUMNNAME_M_PriceList_ID))
list.add(new CattleyaCalloutFromFactory());
if (tableName.equals(MProduct_CAT.Table_Name) && columnName.equals(MProduct_CAT.COLUMNNAME_C_TAXCATEGORY_ID))
list.add(new CattleyaCalloutFromFactory());
return list != null ? list.toArray(new IColumnCallout[0]) : new IColumnCallout[0];
}
}