I was just wondering if there is any way of popping a lookup form during the program execution.
We have seen many ways of creating lookups – EDT’s, relations, AutoLookup and through custom code [SysTableLookup]
Let us consider an example: I have a select query whose behaviour should be dynamic based on the User input. We might have used query Framework classes many a times to do this.
I was just going through the standard classes and found this code useful with minimum tweaking of code.
Try out the below example: This example will help you to select the custAccount and based on the selected customer account it brings you the last invoiced sales order.
Note: The columns in the form are built runtime using the AutoLookup fields.
static void SR_expressionBuilderLookUp(Args _args)
ExtendedDataTypeName extendedDataType = extendedtypestr(custAccount);
Args args = new Args(formstr(SysExpressionBuilderLookup));
expressionBuilderLookup = new FormRun(args);
custAccount = expressionBuilderLookup.parmSelectedValue();
info(strfmt(‘Last SO of customer %1 is %2’, custAccount, CustTable::find(custAccount).lastInvoice().SalesId));