axapta - 斧头 2009 : Report Range on enums parsing enum value commas?

标签 axapta dynamics-ax-2009

我想我可能发现了 AX 2009 的一个有趣的错误,但我不确定如何继续。

我正在尝试编写一份新报告,该报告的条件之一是根据 LedgerTrans 表的 Posting 字段进行过滤。但是,似乎当报告执行时,会解析枚举 Purchase,receipt 的标签,而不考虑引号。这通常不会成为问题,但本例中的枚举标签包含逗号。结果是,运行查询对话框时显示:购买、消费、__ILLEGAL_VALUE__。 即使我使用枚举值或名称,我也会得到此结果。报表必须保持交互式,但该字段必须被锁定,因此我们无法让用户在运行时调整查询。

此时我不想更改标签本身,但如果这是解决此问题的唯一方法,我会这样做。有没有其他人遇到过这个问题,或者知道我们如何克服它?

最佳答案

我以前也遇到过这种情况。有时,可接受的选项是将条件值硬编码为 OR 语句,而不是逗号分隔的列表:

((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) || (LedgerTrans.Posting == LedgerPostingType::PurchConsump))

可以将其输入到范围过滤器框中,也可以通过 x++ 代码将其设置为范围值:

ledgerPostingRange.value("((LedgerTrans.Posting == LedgerPostingType::PurchReceipt) ||
                           (LedgerTrans.Posting == LedgerPostingType::PurchConsump))");

AX 不会尝试将它们转换为标签,因此它们保留为不同的值,而不是呈现为标签。请注意,需要括号才能正确解析。

由于即使在尝试使用标签中包含逗号的单个值时也会出现 ILLEGAL_VALUE,因此对于单个 : 也可以执行相同的操作:

ledgerPostingRange.value("(LedgerTrans.Posting == LedgerPostingType::PurchReceipt)");

关于axapta - 斧头 2009 : Report Range on enums parsing enum value commas?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9982388/

相关文章:

axapta - 在 changeCompany 中使用 return 时是否有必要还原某些内容

x++ - 如何确保一个表单只被打开一次?

lookup - 动态 AX 2009 : Displaying a name instead of an ID in a lookup field

axapta - 将许多列添加到表单上的网格中

axapta - 操作数类型与 AX2009 中的运算符不兼容

php - 如何在没有管理权限的情况下向 Axapta 数据库添加其他信息?

models - 在 AX7 中将工件从 1 个模型移动到另一个模型

group-by - Axapta:Group By 子句后出现 "The record has never been selected"错误

foreign-key-relationship - 该表仅允许外键约束 AX 2012