PICK ONE OR MORE FROM to string
PICK ONE OR MORE FROM to string
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.
-
- Posts: 1459
- Joined: Tue Jan 24, 2017 5:51 am
- Location: 'Stralya
Re: PICK ONE OR MORE FROM to string
Call a second process with an input of the States BO.
Process 1
Process 2 Input States
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.
Process 1
Code: Select all
FIND States
Process2
Code: Select all
IF LIRU.States IS UNDEFINED THEN LIRU.States=States.Code ELSE LIRU.States=LIRU.States+','+States.Code
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.
Re: PICK ONE OR MORE FROM to string
Thanks very much, PointsWell! Greatly appreciated!