自定义查找和分组依据

编程入门 行业动态 更新时间:2024-10-10 07:29:50
本文介绍了自定义查找和分组依据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

TLDR:当使用查找的字段不为空时,为什么在查找中禁用了group by子句?

TLDR: Why group by clauses are disabled in lookups when the field using the lookup is not empty?

我想在表单中的字段上进行自定义查找.表CTable看起来像这样:

I want to do a custom lookup on a field in a form. The table CTable looks like this:

Val Spec ------------ A alpha A beta A gamma B delta C epsilon

查找仅涉及Val列,该列是使用具有基本关系的EDT定义的:Val == CTable.Val

The look up only concerns the Val column which is defined using an EDT with a basic relationship on it: Val == CTable.Val

查找显然给了我这样的列表:

The lookup obviously gives me a list like this:

A A A B C

让我们分组讨论,以消除所有重复的As,我想! 类似于:

Let's to a group by to get rid of all the duplicated As, I thought! Something along the lines of:

QueryBuildDataSource.orderMode(OrderMode::GroupBy); QueryBuildDataSource.addGroupByField(fieldNum(CTable, Val));

现在出现了我的怪异行为以及问题的实质.在一个空字段上,正确执行了分组依据,我得到了:

Now comes the strange behaviour I have and the actual point of my question. On an empty field, the group by is correctly executed and I get this:

A B C

现在让我们在查找中选择"A",然后再次执行查找 ,因为我想单击"B".现在,由于未知原因,group by被禁用了,我得到的查找结果与之前的查找结果相同.

Now let's select "A" in the lookup, then perform the lookup again because I wanted to click on "B" instead. The group by is now disabled for unknown reasons and I get the same look up results as the first I had before.

为什么会这样?我该如何克服?

Why is it so? How can I overcome that?

推荐答案

相同的问题和有用的答案: dynamicsuser/forums/t/63438.aspx

Same question and usefull answer: dynamicsuser/forums/t/63438.aspx

您可以通过将SysTableLookup中的useLookupValues设置为false来禁用此行为.不幸的是,我不知道为什么AX会这么做.我怀疑它会将OrderMode更改为OrderBy.

You can disable this behavior by setting useLookupValues in SysTableLookup to false. Unfortunately I don't know exactly why AX does that. I suspect that it changes OrderMode to OrderBy.

更多推荐

自定义查找和分组依据

本文发布于:2023-11-22 02:15:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1615575.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!