General X++ Development
How do I create a lookup in X++?
How do I create a lookup in X++?
1 answer
Write an answerFor a simple custom table lookup, use SysTableLookup.
SysTableLookup sysTableLookup =
SysTableLookup::newParameters(tableNum(CustTable), _formControl);
sysTableLookup.addLookupfield(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupfield(fieldNum(CustTable, NameAlias));
sysTableLookup.performFormLookup();Before building a custom lookup, check whether the EDT/table relation already gives you the lookup you need. A custom lookup is useful when the standard relation is not enough, not as the default for every field.
Know the solution?
Sign in to contribute an answer and build your community reputation.
Sign in to answer