我的对话框也有类似的问题,但是没有控制调用方法出现错误。
我正在尝试覆盖对 CustAccount 类型的对话框字段的查找 - 我想要的是查找以返回 invoiceAccount 具有特定值的所有 custTable 记录。
这是我的代码:
class AG_UpdateQuoteCust extends Runbase
{
DialogField dlgCust;
CustAccount newCust;
CustAccount custAccount;
#define.CurrentVersion(1)
#define.Version1(1)
#localmacro.CurrentList
custAccount
#endmacro
}
public Object dialog()
{
DialogRunbase dlg;
;
dlg = super(dlg);
dlg.caption("Change quotation customer account");
dlg.addText('Please select an alternative customer account');
dlgCust = dlg.addField(typeid(CustAccount),'Customer account');
dlgCust.fieldControl().mandatory(true);
if(!dlgCust)
{
error('Please fill out all mandatory fields');
}
return dlg;
}
void Fld2_1_lookup()
{
Dialog dlg = this.dialog();
SysTableLookup sysTableLookup;
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
Query query;
Str TmpStr;
Formrun fr = this.dialogModify().parmDialog();
Object Control = fr.controlCallingMethod();
FormStringControl _control = control;
;
sysTableLookup = SysTableLookup::newParameters(tablenum(CustTable),_control);
sysTableLookup.addLookupfield(fieldnum(CustTable, AccountNum),true);
sysTableLookup.addLookupfield(fieldnum(CustTable, Name));
sysTableLookup.addLookupfield(fieldnum(CustTable, NameAlias));
query = new Query();
queryBuildDataSource = query.addDataSource(tablenum(CustTable));
tmpStr = 'ADAM001H';
queryBuildRange = queryBuildDataSource.addRange(fieldnum(CustTable, InvoiceAccount));
queryBuildRange.value(TmpStr);
sysTableLookup.parmQuery(query);
sysTableLookup.performFormLookup();
}
public void dialogPostRun(DialogRunbase dialog)
{
;
Super(dialog);
dialog.formRun().controlMethodOverload(true);
dialog.formRun().controlMethodOverloadObject(this);
}
你能告诉我我哪里出错了 - 事实上,我并不真正理解 dialogPostRun 方法的这种覆盖或 ControlCallingMethod 的使用。