Dynamics AX 2009:转到主表窗体 - 如何选择默认行?

发布于 2024-10-31 18:17:06 字数 641 浏览 4 评论 0原文

我正在重写表单设计中下拉控件上的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌路终见情 2024-11-07 18:17:06

经过更多的实验,我找到了答案。添加这一行解决了我的困境:

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.

柠檬色的秋千 2024-11-07 18:17:06

args.record(reasonTable); - 如果使用reasonTable来标识记录进行定位

args.record(reasonTable); - if reasonTable is used to identify the record for positioning

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文