枚举作为 Dynamics AX 中的参数

发布于 2024-08-25 15:37:09 字数 196 浏览 6 评论 0原文

我的报告有一个使用基本枚举的参数。运行报告时,枚举有 4 个不同的选项可供选择。如何插入同时使用全部 4 个选项的选项?

例如,我有一个名为 Phone 的枚举,它有 4 种类型:1 = None、2 = Home、3 = Mobile、4 = Work。在下拉列表中,如何添加选项 5 = None+Home+Mobile+Work?

谢谢你!

My report has a parameter which uses a base enum. The enum has 4 different options to choose when running the report. How do I insert an option which uses all 4 at once?

For example, I have an enum named Phone and it has 4 types: 1 = None, 2 = Home, 3 = Mobile, 4 = Work. In a drop down, how do I add option 5 = None+Home+Mobile+Work?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

奈何桥上唱咆哮 2024-09-01 15:37:09

添加另一个值为 All 的枚举(参见 NoYes 和 NoYesAll 枚举作为示例)

Add anoher enum with value All (see NoYes and NoYesAll enums as example)

安人多梦 2024-09-01 15:37:09

解决问题的一些方法:

  1. 您可以更改您的 Enum 并添加一个新的 EnumValue,其中包含“All”之类的内容(如 AxCoder 答案)。

  2. 如果您不想(或不能)修改此枚举,您可以复制它并使用新值创建一个新的枚举。您有责任保持两者与未来的变化同步。

  3. 您可以保留枚举不做任何更改,并添加另一个参数到报告中,以便您知道查询需要忽略枚举值(您显然,必须对该行为进行编码)

希望这会有所帮助。

Some ways to solve your problem:

  1. You can alter your Enum and add a new EnumValue with something like "All" (like AxCoder answer).

  2. If you don't want (or you can't) modify this Enum you can copy it and create a new Enum with the New value. It will be your responsability to maintain both syncronized with future changes.

  3. And you can leave the Enum without changes, and add another parameter to the report for you to know that the Enum value needs to be ignored by the Query (you have to code that beaviour, obviously)

Hope this helps.

抱猫软卧 2024-09-01 15:37:09

您可以添加到表单上的组合框。
如果将表单上的枚举用作 ComboBox,请确保 AutoDeclare 属性为 Yes。
覆盖表单的Run()方法并添加到组合框的super之后。

示例:

public void run()
{
    super();
    YourComboBox.add("All");
}

在组合框的修改方法上,通过在 ret = super() 之前添加以下代码来添加对单词“All”的检查:

if (YourComboBox.getEditText() == "All")
{
        info("do your stuff"); //Add your code for the all selection here
}

You can add to the combo box on the form.
If you use the enum on the form as a ComboBox, make sure the AutoDeclare property is Yes.
Overwrite the Run() method of the form and add to the combo box after super.

Example:

public void run()
{
    super();
    YourComboBox.add("All");
}

On the modified method of the combo box, add the check for the word “All” by adding the code below before ret = super():

if (YourComboBox.getEditText() == "All")
{
        info("do your stuff"); //Add your code for the all selection here
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文