I hope this can be done and someone can help me out.
What I want to do is have button that pushes a flag to a desktop, which I have working. What I also want is when this same button is pushed it adds text translation to the note to basically indicate a .sign in the chart note to indicate the user has completed this form.
This is where I am stuck. I did try adding into the Action button on the Translation tab some code to enter a user name, but I just cannot get it working.
Any suggestions?
Thanks!!
If you can't get the translation in the button to work you can always hide an edit box with a visibility region set to false. Then have the button populate the document variable or obs term with USER.REALNAME or whatever data symbol you need.
Put this in the MEL area on your button. Change to whatever you want. My Edit field variable is named EDIT1 so change that to the name of your edit field.
{DOCUMENT.EDIT1 = USER.REALNAME + str(._TODAYSDATE) +MEL_SEND_FLAG ("Flag", "To User", "Urgent", str(._TODAYSDATE), "SUBJECT FIELD", "This is a test of the emergency broadcast system", "Summary", "")}
One quick suggestion on this is that you probably don't want to concatenate the result of the MEL_SEND_FLAG. You probably want two statements in the MEL expression:
{
MEL_SEND_FLAG ("Flag", "To User", "Urgent", str(._TODAYSDATE), "SUBJECT FIELD", "This is a test of the emergency broadcast system", "Summary", "")
DOCUMENT.EDIT1 = USER.REALNAME + str(._TODAYSDATE)
}
If you wanted to make it more complicated you could check the result of the MEL_SEND_FLAG and display an error message if it fails and put the signature in if it doesn't, but that might be overkill.
This does assume that there is a separate edit field and that it is actually providing the translation.
There are ways to do this with a hidden field if you don't want it to show up in the form or without a filed altogether if desired.