Dynamics AX 2009:转到主表窗体 - 如何选择默认行?
我正在重写表单设计中下拉控件上的 JumpRef 方法。下面是该方法的代码。目前,它显示表的表单,其中所有行都可见。不过,到目前为止一切顺利,我希望在新的主表窗体显示时,在初始窗体上选择的特定行能够在新的主表窗体上突出显示。
public void jumpRef()
{
ReasonTable reasonTable;
Args args;
MenuFunction menuFunction;
;
// Use whole table (i.e. No filtering, show all rows)
reasonTable = ReasonTable;
// Establish this form as the caller
args = new Args();
args.caller(element);
// Create a new MenuFunction that launches the Reasons Menu Item
menuFunction = new MenuFunction(
menuitemdisplaystr(Reasons),
MenuItemType::Display);
menuFunction.run(args);
}
I am overriding the jumpRef method on a drop down control in the design on my Form. Below is the code from that method. Currently, it shows the Form for the table with all rows visible. So far so good, however, I would like the specific row that had been selected on the initiating Form to be highlighted on the new Main Table Form when it displays.
public void jumpRef()
{
ReasonTable reasonTable;
Args args;
MenuFunction menuFunction;
;
// Use whole table (i.e. No filtering, show all rows)
reasonTable = ReasonTable;
// Establish this form as the caller
args = new Args();
args.caller(element);
// Create a new MenuFunction that launches the Reasons Menu Item
menuFunction = new MenuFunction(
menuitemdisplaystr(Reasons),
MenuItemType::Display);
menuFunction.run(args);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过更多的实验,我找到了答案。添加这一行解决了我的困境:
args.lookupRecord(reasonTable::find(this.text()));
它完全达到了我希望完成的目标。我之前尝试过,但无法弄清楚要放入该方法中的对象/值。
After some more experimentation, I was able to find the answer. Adding this line solved my dilemma:
args.lookupRecord(reasonTable::find(this.text()));
It did exactly what I was hoping to accomplish. I tried this before, but couldn't figure out what object/value to put into the method.
args.record(reasonTable);
- 如果使用reasonTable来标识记录进行定位args.record(reasonTable);
- if reasonTable is used to identify the record for positioning