Here is an example that shows how you can add look up on a field. I wrote my code in OnLookup event.
public static void LedgerParameters_FinDimName_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), sender);
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));
Query query = new Query();
query.addDataSource(tableNum(DimensionAttribute)).addRange(fieldNum(DimensionAttribute, BackingEntityType)).value(queryValue(tableNum(DimensionFinancialTag)));
sysTableLookup.parmQuery(query);
//perform lookup
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
ce.CancelSuperCall();
}
public static void LedgerParameters_FinDimName_OnLookup(FormControl sender, FormControlEventArgs e)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(DimensionAttribute), sender);
sysTableLookup.addLookupfield(fieldNum(DimensionAttribute, Name));
Query query = new Query();
query.addDataSource(tableNum(DimensionAttribute)).addRange(fieldNum(DimensionAttribute, BackingEntityType)).value(queryValue(tableNum(DimensionFinancialTag)));
sysTableLookup.parmQuery(query);
//perform lookup
sysTableLookup.performFormLookup();
FormControlCancelableSuperEventArgs ce = e as FormControlCancelableSuperEventArgs;
ce.CancelSuperCall();
}
*This post is locked for comments