Monday, 29 July 2024
Override Lookup of form control.
[ExtensionOf(formStr(VendEditInvoice))]
final class XXX_VendEditInvoice_Extension
{
public void overridePaymSpecLookup(FormStringControl _formControl)
{
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(VendPaymModeSpec), _formControl);
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
VendInvoiceInfoTable vendInvoiceInfoTable = _formControl.formRun().dataSource().cursor() as VendInvoiceInfoTable;
queryBuildDataSource = query.addDataSource(tableNum(VendPaymModeSpec));
queryBuildDataSource.addRange(fieldNum(VendPaymModeSpec, PaymMode)).value(queryValue(vendInvoiceInfoTable.PaymMode));
sysTableLookup.addLookupfield(fieldNum(VendPaymModeSpec, Specification));
sysTableLookup.addLookupfield(fieldNum(VendPaymModeSpec, PaymMode));
sysTableLookup.addLookupfield(fieldNum(VendPaymModeSpec, Name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
public void init()
{
next init();
PaymentInvoice_PaymSpec.registerOverrideMethod(methodStr(FormDataObject, lookup), formMethodStr(VendEditInvoice, overridePaymSpecLookup));
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment