Monday, 13 October 2014

to get unique values in a customized field look up

SysTableLookup    sysTableLookup;
  QueryBuildDataSource    queryBuildDataSource;
  QueryBuildRange         queryBuildRange;
  Query query = new Query();
  sysTableLookup = new SysTableLookup();
  sysTableLookup = SysTableLookup::newParameters(tableNum(tablename), this);
  sysTableLookup.addLookupfield(fieldNum(tablename,fieldname));


   //create the query datasource
  queryBuildDataSource = query.addDataSource(tablenum(tablename));
  queryBuildRange = queryBuildDataSource.addRange(fieldnum(GTFS_PayrollEmpPeriodHeader, fieldname1));
  queryBuildRange.value(tablename.fieldname1);
     queryBuildDataSource.addSortField(fieldnumtablename,fieldname));
    queryBuildDataSource.addOrderByField(fieldnumtablename,fieldname));
    SysTableLookup.parmUseLookupValue(false);
    queryBuildDataSource.orderMode(OrderMode::GroupBy);

  sysTableLookup.parmQuery(query);
  sysTableLookup.performFormLookup();

No comments:

Post a Comment

intercompany PO multiple product receipt by x++

public void processStampICPO(PackingSlipId _deliveryNote,                             Transdate _deliverydate,                             ...