RobertP
9th October 2023, 12:45
Hello,
10.7 OP.
Main table Z, has reference to table X (combined field) 'mandatory unless empty'.
Session based on Main table Z contains a field from referenced table X.
- Field X.abcd displays correctly
- Field X.abcd is available in 'filter' option of session (BECS)
However, in 'filter - define sort' option, the field is not available. What is causing this?
Thanks
RobertP
9th October 2023, 12:46
Note = This is a customized module and session.
RobertP
17th October 2023, 17:47
Any takers or good ideas? Thanks
OmeLuuk
13th November 2023, 16:04
{Edit: I misread, I think now fixed}
Let me try, You say table X has field abcd with a reference from table Z to table X (say field Z.key1 = X.key1)
In session "Filters" [ttadv9593m000] in bw you can select field X.abcd and set a condition.
This implies the field is visible and can be filtered on although is is added to your session via the reference from Z to X (on field key1).
You do not mention if field X.abcd is part of (any) index on table X. Is that the case?
But to be able to use field X.abcd as a sort field, then more is needed.
For using a field of table Z in the sort option, you would have to set the index use in the session: Maintain Sessions, select Specific, Indices... "Available Indices by Session" [ttadv2101s000] There you can change the sort order and availability of keys on the (main)table.
Normally it is not possible to sort on a secondary table due to the internal links that are needed to achieve that. There is an undocumented (!) function "query.extend.order" to change the sort order of a session (which works fine when applied on the fields in the maintable itself).
I had one situation where I would sort on field non index field X.sort based on the reference from Z.key1 = X.key1. Table Z used an attribute name which was defined in table X, as Z.attr = X.attr and display order as X.sort.
I used query.extend.order in the past with moderate success to sort (like you want) on (in my case a non-index) field of a secondary table. (Had to fix the TIV to a low level to have something sorted).
Infor Support urged me to use query.define.sort.order ("new" since TIV 1900) instead. But this can only be used when the field in the secondary table is in any index, as far as I understood.
In my case the problem is that LN-UI would show wrong data, even with a low TIV fixed.