Sort Multi-Select Lookup when Lookup table is in a different application.
I think I'm close on this, but it's not quite working. This is my function created in the application containing the table of selections:
collection sortfeats()
{
sortlist = (pressing_features[ID != 0].pressing_features sort by Added_Time asc).getAll();
return Collection(sortlist);
}
When I execute the function it returns the list of items successfully, in the order I want.
In the application containing the form w/ the Lookup field, I have this coded on-load of the form:
sortlist = pressing_features.sortfeats();
input.Pressing_features:ui.add(sortlist);
"pressing features" (lower case p) is the application name containing the table.
"Pressing features" (upper case P) is the name of the lookup field in the other application.
When I remove the ".getAll" from the first function, the lookup field returns the first item in the list only, but it's the correct first item based on how I want it sorted. So, it seems that I'm doing something right. But w/ the ".getAll" included in the function the Lookup field becomes empty w/ no selections available.
Any ideas out there...Thanks!