Monday, 1 May 2017

SysMultiTableLookup for Multiple lookup fields from multiple tables

   public void lookup()

   {

    SysMultiTableLookup  sysMultiTableLookup;
    Query                query;
    QueryBuildDataSource queryBuildDataSource,qbds1;
    QueryBuildRange      qbr;
    VendTable            vendtable;
    DirPartyTable        dirPartyTable;
    super();

 
    query = new Query();
    queryBuildDataSource = query.addDataSource(tableNum(VendTable));
    qbds1                =  queryBuildDataSource.addDataSource(tablenum(DirPartyTable));
    qbds1.relations(true);

    sysMultiTableLookup =   SysMultiTableLookup::newParameters(VendorAcc,query);
   //vendorAcc is control name

    sysMultiTableLookup.addLookupfield(fieldNum(VendTable,AccountNum),1);
    sysMultiTableLookup.addLookupfield(fieldNum(dirPartyTable,Name),2);

    sysMultiTableLookup.parmQuery(query);
    sysMultiTableLookup.performFormLookup();
}

1 comment:

  1. Thanks for the sharing. Can you please share the class sysMultiTableLookup as its not OTB class.

    ReplyDelete