Axapta/Dynamics Ax 中整数字段的范围

发布于 2024-07-09 13:45:10 字数 170 浏览 7 评论 0原文

在 Axapta/Dynamics Ax 中,有没有一种方法可以创建整数类型的扩展数据类型,它只允许在指定范围内生成值(即,如果扩展数据类型用于存储年份,我应该能够设置范围如 1900-2100),或者我是否必须使用 X++ 代码来管理范围?

如果我需要使用 X++ 代码来管理范围,那么最好的方法是什么?

Is there a way, in Axapta/Dynamics Ax, to create an Extended Data Type of type integer which only allows enering values in a specified range (i.e., if the extended data type is meant for storing years, I should be able to set a range like 1900-2100), or do I have to manage the range using X++ code?

And if I need to use X++ code to manage the range, which is the best way to do it?

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

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

发布评论

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

评论(2

同展鸳鸯锦 2024-07-16 13:45:10

我建议您使用相应表的“validateField”。
在 AOT\Data Dictionay\Tables 中搜索该方法可以看到很多示例。

I suggest you use the ''validateField'' of the corresponding table.
Search for the method in AOT\Data Dictionay\Tables to see many examples.

野稚 2024-07-16 13:45:10

您无法指定扩展数据类型本身的范围。 如果该类型用于表字段,则可以将代码添加到表的插入和更新方法中,以便在更新记录时验证该值。 然而,这种方法可能会降低性能。

如果您对仅在从 UI 修改值时发生的验证感到满意,您还可以选择仅在表的 validateWrite 方法中添加代码。

You can can't specify the range on the extended data type itself. If the type is used for a table field, you can add code to the insert and update methods of the table, in order to validate the value whenever the record is updated. This approach could however have a cost in terms of performance.

You can also choose to just add code the the validateWrite method of the table, if you are satisfied with the validation only taking place when the value is modified from the UI.

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