Lookup of FieldName

i am looking to get a lookup of the fieldnames in a form.The lookup should contain the fieldnames of the Form datasource that it is called from.

For eg : if on purchTable form , it shoud show a lookup of the fields from PurchTable.

Any Help is aprreciated



try this,

public void lookup()
Query query = new Query();
QueryBuildDataSource qbds;
QueryBuildRange queryBuildRange;
SysTableLookup sysTableLookup;


sysTableLookup = SysTableLookup::newParameters(tablenum(tablename), this);
sysTableLookup.addLookupfield(fieldnum(tablename, BranchName));

sysTableLookup.addLookupfield(fieldnum(tablename, BranchCode));

sysTableLookup.addLookupfield(fieldnum(tablename, RegionCode));

qbds = query.addDataSource(tablenum(tablename));
QueryBuildRange = qbds.addRange(fieldnum(tablename,RegionCode));
QueryBuildRange.value(RegionCode.valueStr()); // Make the auto declaration yes for that control and do it.


Looking for a Lookup of “FieldNames” of a Table, i.e. listing all the fields available in the table.

Use SysTableFieldLookup class. Pass the form query to the constructor, save TableId to TmpSysTableField table (DictTableId field) and pass it to performLookupField().

static void Job1(Args _args)


int tableID;

str fieldName;

int fieldId;






I was looking for the same thing and this is what I got so far.

If you want the code just tell me this is what you are looking for.

simple code

at classDeclaration
SysTableFieldLookup tableFieldLookup; // function for lookup field
TmpSysTableField tmpSysTableField; // to catch selected lookup value

at lookup method:
Query query = new Query();
tableFieldLookup = new SysTableFieldLookup(query);
tmpSysTableField.DictTableId = tableNum(SalesLine);
tableFieldLookup.performLookupField(this, tmpSysTableField); // lookup display label description

at modified method after super
FieldId fieldIdNum;
fieldIdNum = tableFieldLookup.parmSelectedRecord().FieldId; // get the field id