Thanks Jerroll.
This saves me from writing something like this it myself 🙂
Appreciated.
- Beverly
Did you get this working for you ?
When you store the 2 listboxes data into the same obsterm, their individual data should be separated from each other (not with a comma). Use a "~", for example, between the selected data items of DOCUMENT.GENERAL and DOCUMENT.LISTBOX.
Then later when you do OBSPREV, you will have the data separated by "~" so you know the first data set goes back into DOCUMENT.GENERAL, and the 2nd data set gets assigned back to DOCUMENT.LISTBOX.
Try using the Combine function with a "~"
{ OBSNOW("ROS:GENERAL", Combine("~", DOCUMENT.GENERAL, DOCUMENT.LISTBOX) ) }
Then for OBSPREV, assign the obsprev data back into the listboxes this way:
DOCUMENT.GENERAL = SplitTildes( OBSPREV("ROS:GENERAL"), 1)
DOCUMENT.LISTBOX = SplitTildes( OBSPREV("ROS:GENERAL"), 2)
Hi. Sorry for the delay, I got sidetracked on a different project. Thank you for all the advice. However, I can't get it working.
Where am I putting the
DOCUMENT.GENERAL = SplitTildes( OBSPREV("ROS:GENERAL"), 1)
DOCUMENT.LISTBOX = SplitTildes( OBSPREV("ROS:GENERAL"), 2)
In a button? I am confused. I'm trying to attach my form, but am not sure how.
From your example, I am assuming you have a ROS form.
Copy the Combine and SplitTildes functions into your forms MEL coding area to the right – keep the { } just as Jerroll posted them.
First you have to save the ROS values…
In the code area where you have these lines
{OBSNOW(
"ROS:GENERAL",fncommacombine(DOCUMENT.GENERAL,DOCUMENT.LISTBOX))}
{OBSNOW(
"ROS EYES",fncommacombine(DOCUMENT.GENERAL1,DOCUMENT.LISTBOX1))}
…
change them to this (using the Combine function with a "~")
{ OBSNOW("ROS:GENERAL", Combine("~", DOCUMENT.GENERAL, DOCUMENT.LISTBOX) ) }
{ OBSNOW("ROS EYES", Combine("~", DOCUMENT.GENERAL1, DOCUMENT.LISTBOX1) ) }
…
Then what do you want ?
1) One big [PREV] button for all the ROS sections ?
2) Or an individual [PREV] button for each individual ROS section ?
Or both ?
For One big [PREV] button for all the ROS sections, do this.
Create a button, Labeled "PREV", choose TYPE "RUNPROCESS"
In the code area of the button, assign obsprev back to the ROS listboxes this way:
{
DOCUMENT.GENERAL = SplitTildes( OBSPREV("ROS:GENERAL"), 1)
DOCUMENT.LISTBOX = SplitTildes( OBSPREV("ROS:GENERAL"), 2)
DOCUMENT.GENERAL1 = SplitTildes( OBSPREV("ROS EYES"), 1)
DOCUMENT.LISTBOX1 = SplitTildes( OBSPREV("ROS EYES"), 2)
…
}
This should work for you. If you are also saving comments for each ROS section,
then you would modify the above like this
For example, if you have under GENERAL ROS, a multi line edit field named DOCUMENT.ROS_GENERAL_CMT
{ OBSNOW("ROS:GENERAL", Combine("~", DOCUMENT.GENERAL, DOCUMENT.LISTBOX, DOCUMENT.ROS_GENERAL_CMT) ) }
and to get it's obsprev value, you would change it like this
DOCUMENT.GENERAL = SplitTildes( OBSPREV("ROS:GENERAL"), 1)
DOCUMENT.LISTBOX = SplitTildes( OBSPREV("ROS:GENERAL"), 2)
DOCUMENT.ROS_GENERAL_CMT = SplitTildes( OBSPREV("ROS:GENERAL"), 3)
Please let us know how this works out for you.
Lets give Jerroll a high-five for his fine functions!
regards,
Beverly
Works beautifully!!! Thank you thank you thank you!
Rebecca, Could you give votes on the posts above that helped you (Jerrolls functions especially!). Then select one which answered your question to mark with a Check - as Solved. - B