If you have questions or if you want to share your opinion about Aware IM post your message on this forum
#54233 by Stetson
Tue Jun 30, 2020 9:39 pm
How do I capture the results of PICK ONE OR MORE FROM to a single comma-delimited string? Let's say we're picking 10 state abbreviations out of 50 and want to store the result as "TX,CA,KY,NY,MO,..." etc. I've defined a string to hold the result (LoggedInRegularUser.tmp_States). Immediately following the PICK ONE OR MORE FROM, I'm doing "LoggedInRegularUser.tmp_States = LoggedInRegularUser.tmp_States + States.ID + ',' ". Obviously this is giving me the first selected entry only, followed by a comma. How do I loop through ALL 10 selections? I know they're in context, but what's the syntax to access them individually? Thanks.
#54234 by PointsWell
Tue Jun 30, 2020 10:06 pm
Call a second process with an input of the States BO.

Process 1
Code: Select allFIND States
Process2


Process 2 Input States
Code: Select allIF LIRU.States IS UNDEFINED THEN LIRU.States=States.Code ELSE LIRU.States=LIRU.States+','+States.Code


Process 1 finds all the states, process 2 adds each of these one at a time. Will give you an LIRU.States that is 'AL,AK,NY'

Unless you need that state list to be in context for other processes that are unconnected you could use a non persisted BO during the process that requires the list of states. The benefits of this are that the non persisted BO never has to be cleared as it disappears after the end of the process that it is attached to, whereas you will need to reset LIRU every time that you use it.

Who is online

Users browsing this forum: Majestic-12 [Bot] and 33 guests