I am looking to use the SETVALUES function of an action button but don't want to use an action button. Is there any way to do that? Also, I would need to use the Append and Overwrite parts of the function as well. thoughts?
Set the desired value of the fields in code: document.xxx="something" or document.xxx=document.xxx+"something". The problem is triggering the action. This can be done at form load, or triggered by some other action. But no matter how you slice it, something has to occur to initiate the action, e.g. click a button.
So no way to use setvalues from anything other than an action button?
Set values is just a built in function in your form editor. there is no actual MEL code called SETVALUES. instead the code in the Form Editor is just asking you for the item name, and what to set it to, but is then running code that is similar to the following:
{DOCUMENT.CHECK_BOX = "Yes"
OBSNOW("HPI","Words that go in the patient HPI...")
DOCUMENT.RADIO_BUTTON = "Wednesday"
}
So in the end, the SETVALUES is just a fancy wrapper for the basic MEL code to set Document Variables and Obs terms. if you need help in figuring out how and where to use the MEL code for setting different values, please let us know. ^_^
the problem with using what you suggested is that the box is rendered useless for anything else. I am just going to use a different work around. thanks for your help.
You could create a watcher expression for whatever you are using to instantiate the SETVALUES expression:
{! IF DOCUMENT.XXX "" THEN
DOCUMENT.ABC = "Yes"
DOCUMENT.XYZ = "No"
ELSE
DOCUMENT.ABC = ""
DOCUMENT.XYZ = ""
ENDIF}