假设我想在作业/代码中打开供应商表单。我编写了一个非常简单的选择语句,稍后我想用它来打开该特定供应商的供应商表单。我怎样才能实现这个目标?
VendTable vend;
MenuFunction menuFunction;
Args args = new Args();
select vend
where vend.AccountNum like "*0009*";
info(vend.AccountNum); - shows an AccountNum
args.record(VendTable::find(vend.AccountNum));
menuFunction = new MenuFunction(menuitemdisplaystr(VendTable), MenuItemType::Display);
menuFunction.run(args);
供应商表单已打开,但未设置数据。如有任何帮助,我们将不胜感激。
最佳答案
如果 info(vend.AccountNum);
实际上在屏幕上输出了一个有效的供应商,那么您的代码没有任何问题并且应该可以工作。如果它不起作用,我猜你有某种修改或损坏的供应商数据。我用 AX 2009 进行了测试。我测试了您的代码和我自己的版本。这是我测试过的工作代码:
Args args = new Args();
VendTable vendTable;
;
select firstonly vendTable;
if (!vendTable)
error("Missing vendor");
args.record(vendTable);
new MenuFunction(menuitemdisplaystr(VendTable), MenuItemType::Display).run(args);
关于axapta - 如何打开包含所选记录的表单?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19657872/