Dynamics AX 中的复杂数据源问题
我有一个显示表格中的行的网格。现在,我有这两个要求:
- 仅显示包含“小时”字段中的值的行。 “小时”字段是数组类型。
- 显示项目及其子项目中的行
我的问题是这样的:为了满足要求#1,我需要在数据源中使用 select 语句,因为我无法使用 QueryBuildDataSource 访问数组值(这是已知的 Dynamics AX 中的限制)。
但为了满足要求#2,我需要有两个“存在连接”,而这在 Dynamics AX 中是不可能的。例如,以下代码将不起作用:
select from table where
exists join tableChild where projectId = MyProjectId OR
exists join tableChild where parentProjectId = MyProjectId
有人会如何解决这个问题?
I have a grid that displays lines from a table. Now, I have these two requirements:
- Show only the lines that contains values in the "hour" fields. The "hour" field is an array type.
- Show the lines from a project and its subproject
My problem is this: to meet requirement #1, I need to use a select statement in my datasource since I cannot access array value using QueryBuildDataSource (this is a known limitation in Dynamics AX).
But to meet requirements #2 I need to have two "exists join", and this is not possible in Dynamics AX. For example the following code would not work:
select from table where
exists join tableChild where projectId = MyProjectId OR
exists join tableChild where parentProjectId = MyProjectId
How would someone address this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
从您提供的 select 语句示例来看,似乎没有必要有两个存在连接。对于其 where 子句中的两个可能条件,使用“OR”的单个存在连接可能就足够了,当然,表和 tableChild 之间仍应具有某种关系,以使连接具有逻辑意义。
From the select statement example you provided, it appears it may not be necessary to have two exist joins. A single exists join with the "OR" for the two possible conditions in its where clauses may be sufficient, of course, you should still have some relationship between table and tableChild for the join to make logical sense.
您可以使用 fieldID2Ext 函数在提供字段 ID 的查询范围中使用数组值。
您可以构建视图并在其上应用配置。
You can use array values in query ranges providing field IDs using fieldID2Ext function.
You can build view and apply confitions on top of it.