Example from 8.2 Docs PDF
<<LIST_LINE(Client.Children,’ORDER BY Child.FirstName DESC‘,‘ ‘,’,’,‘FirstName’, ‘LastName’, ‘Age,#’)>>
Example from Java hint popup in 8.2
LIST_LINE(Client.Children,'ORDER BY Client.Name DESC',',',', ','FirstName', 'LastName','Age')
PROBLEM
part of the problem is that the Docs tradiationally have bad Typos - which cause frustration when you copy/paste code and it won't event syntax check. then there's the issue with the ` marks vs '
I don't think thats an issue here. I was using the online tool hint (tap F4) - this example doesn't even make sense. Why would you generate this long string of each of the kids, sorted by the name of mother or father (Client.Name is not even a field in the Client.Children table_? UNLESS, the word Children is meant to mean "child recs of a parent record" and not actual biological units and its not meant to be a real example, only figurative. I dunno.
In either case this is wrong... and I can't figure it out.
This example is supposed to print a list of kids... all the kids that are in a reference table (Children) for a given Client record.
this COULD be a possibility:
LIST_LINE(Client.pm_Children,'ORDER BY Client.pm_Children.FirstName DESC',',',', ','FirstName', 'LastName','Age')
a) added pm_ to help distinguish thats its a list and not just a regular field
b) changed to Client.pm_Children.FirstName because you want the list of kids' names sorted
This works, but the customer is going to ask "Why are they not in order?"
My list came out: SALT LAKE CITY, MACON, ATLANTA, PITTSBURGH, PHILADELPHIA
RegularUser.CanOrderFor = LIST_LINE(RegularUser.pm_OrderAffils ,',',', ','ShortName')
Now, if you want it to be sorted A-Z, the HINT (which is incorrect) implies this:
RegularUser.CanOrderFor = LIST_LINE(RegularUser.pm_OrderAffils, 'ORDER BY RegularUser.pm_OrderAffils.ShortName ASC' ,',',', ','ShortName')
Creates this string: RICHMOND, SALT LAKE CITY, MACON, PITTSBURGH, PHILADELPHIA
Which isn't even sorted by ID. this is from Tomcat output after the SAVE: Mast_Cust:200078@PHILADELPHIA|Mast_Cust:200079@PITTSBURGH|Mast_Cust:200068@MACON|Mast_Cust:200086@SALT LAKE CITY|Mast_Cust:200083@RICHMOND
Macon shud be in front if its by ID, and its not Alpha sort. Doesn't really matter what it is, its NOT what was specified.
- So, last resort, try the QUERY option... because in the Query I could specify an ORDER BY - I'll get this sucker !!!!
<testing now>
jaymer...