Dynamically adding sorted record IDs to a multi-select Lookup field
- IDs = Form1[Criteria].Lookup.getAll().distinct();
- IDsSorted = Form2[ID in IDs] sort by SortField;
- input.MultiSelectLookup.select(IDsSorted);
Original Problem:
I can dynamically add IDs (on User Input of another field) to a multi-select Lookup field, but I can NOT add sorted IDs.
IDs = Form1[Criteria].Lookup.getAll().distinct();
IDsSorted = Form2[ID in IDs] sort by SortField;
input.MultiSelectLookup = ???
I've tried:
input.MultiSelectLookup = IDsSorted.ID.getAll();
input.MultiSelectLookup:ui.add(IDsSorted.ID.getAll()); (or append)
for each id in IDs
{
input.MultiSelectLookup:ui.add(IDsSorted.ID.getAll()); (or append)
}
None of the ui:add or ui:appends work.
The others work, but they add the values in the sort order of the field "Lookup" from Form1 above.
SO weird, and neither I nor Creator Support can figure it out.