Simple UIBuilder Class x++ D365 Finance and Operations
class MZNUKUIBuilder extends SysOperationAutomaticUIBuilder
{
DialogField custId, fromdate, toDate;
MZNUK_Contract contract;
// Code from Moznum.blogspot.com
// Hire ERP consultants from Moznum.com
public void build()
{
contract = this.dataContractObject();
custId = this.addDialogField(methodStr(MZNUK_Contract, parmCategoryName),contract);
fromdate = this.addDialogField(methodStr(MZNUK_Contract, parmFromDate),contract);
todate = this.addDialogField(methodStr(MZNUK_Contract, parmToDate),contract);
}
public void getFromDialog()
{
contract = this.dataContractObject();
super();
}
public void initializeFields()
{
contract = this.dataContractObject();
}
// Code from Moznum.blogspot.com
// Hire ERP consultant from Moznum.com
public void lookup(FormStringControl _control)
{
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
SysTableLookup sysTableLookup;
sysTableLookup = SysTableLookup::newParameters(tableNum(CustTable), _control);
queryBuildDataSource = query.addDataSource(tableNum(CustTable));
sysTableLookup.addLookupField(fieldNum(CustTable, AccountNum));
sysTableLookup.addLookupField(fieldNum(CustTable, Party));
sysTableLookup.addLookupMethod(tableMethodStr(CustTable, name));
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
public void postBuild()
{
super();
contract = this.dataContractObject();
custId = this.bindInfo().getDialogField(contract, methodStr(MZNUK_Contract ,parmCategoryName));
custId.registerOverrideMethod(methodStr(FormStringControl, lookup), methodStr(MZNUKUIBuilder, lookup ),this);
if(custId)
custId.lookupButton(2);
}
public void postRun()
{
}
}
No comments:
Post a Comment