Monday 4 August 2014

How to Filter the Vendor Accounts based on Particular Vendor Group



We have to follow some steps:

Step 1:
             Create new table in AOT.

Step 2:
             Add two fields  into the table.

Step 3:
             Go to properties change the first field ExtendedDataType as VendGroupId.

             


           












Step 4:
             Go to properties change the second field ExtendedDataType as VendAccount.
















Step 5:
            Add the Table into Form as Datasource.

Step 6:
            Write the code in lookup method(override) under VendAccount Control.
            
public void lookup()
 
 
{
VendTable vendTable;
ProjectTable projectTable1;
 
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tablenum(VendTable), this);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource = query.addDataSource(tablenum(VendTable));

 sysTableLookup.addLookupfield(fieldnum(VendTable, AccountNum));
queryBuildDataSource.addRange(fieldnum(VendTable, VendGroup)).value(ProjectTable.VendGroup);
 



sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
 
Step 7:
            The Final output Window:
 
 
 

No comments:

Post a Comment