Dear martin,
i have switch the code from table to form level please see two snapshots.
Picture one is the form and second pic is the outcome(which is not showing any data for assetid when creating new entry)
below is the code :
pic 1 :
pic 2 :
public void lookup(FormControl _formControl, str _filterStr)
{
AssetTable assetTable;
EAIndustryType_PM eaindustrytype_pm;
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildDataSource QbdsJoin;
// Instantiate sysTableLookup object using table which will provide the visible fields
SysTableLookup sysTableLookup = sysTableLookup::newParameters(tableNum(eaindustrytype_pm), _formControl);
;
//Check that customer no is not blank.
while (eaindustrytype_pm)
{
// Create the query.
qbds= query.addDataSource(tableNum(eaindustrytype_pm));
qbds.addRange(fieldNum(eaindustrytype_pm, AssetId)).value();
// qbds.addRange(fieldNum(AssetTable, AssetId)).value(asse.CustomerNo);
// qbds.addRange(fieldNum(eaindustrytype_pm, AssetId)).value('EAKHIWS-322');
// qbds.addRange(fieldNum(CustTrans, Allocated)).value('No');;
// Set the query to be used by the lookup form
sysTableLookup.parmQuery(query);
// Specify the fields to show in the form.
sysTableLookup.addLookupfield(fieldNum(eaindustrytype_pm, AssetId));
sysTableLookup.addLookupfield(fieldNum(eaindustrytype_pm, ARCPercent));
sysTableLookup.addLookupfield(fieldNum(eaindustrytype_pm, Industrytype));
// Perform the lookup
sysTableLookup.performFormLookup();
}
}
thank you for your time