Hello,
I cannot get my button to send a flag to the user "ganesthesia." (Ganesthesia is the user's userid). However, I was able to send the flag to myself by using "user.loginname." Does anyone know what I'm doing wrong? Any help is greatly appreciated!
MEL_SEND_FLAG("Flag","ganesthesia","N",Subtractdates(ADDDATES(str(._TODAYSDATE), "0", "", "2"),"0","0","14"), "Anesthesia Endoscopy Form", "Patient "+PATIENT.LABELNAME+" has a BMI > 35 amd is considering undergoing a procedure. Please assess using the STOPBANG form.","Summary","")
Thanks!
I once had an issue using MEL_SEND_FLAG for one particular user. I did a SQL trace running the function and it looks like it requires the user to be active, the loginname to be correct and the field IsRespProv in the USR table (CPS) to be 1 instead of 0. So I looked it up in the database and for some reason that user had 0 in the database for IsRespProv. I got it changed to 1 (I think I did it in the GUI just by changing something saving it, changing it back and saving again) tried again and it worked.
In the third parameter of the ADDDATES() function I would put a zero, but I don't think that should break it. If it worked for user.loginname then that is definitely not an issue. Just personal preference.
I copied your code and had to change 2 things to make it work.
change "N" to "Normal" and make sure your quotes are notepad-quotes. Quotes from wordpad / msword tend to break things for me.
{MEL_SEND_FLAG("Flag","caswelljm","Normal",Subtractdates(ADDDATES(str(._TODAYSDATE), "0", "", "2"),"0","0","14"), "Anesthesia Endoscopy Form", "Patient "+PATIENT.LABELNAME+" has a BMI > 35 amd is considering undergoing a procedure. Please assess using the STOPBANG form.","Summary","")}
Thank you! Did this coding work for you when you tested it on the user? I changed the N to normal and the quotes to notepad quotes but for some reason it still will not work 🙁
Yes, when I copy what is posted it works for me.
Perhaps the user has a typo. Try replacing the user with your login id. If you get the flag, you'll guarantee the problem is there.
-James
When you do this, is it possible to have it send the flag to more than 1 desktop? Just curious.
THANK!
I am not positive but I would think you would just add a comma or pipe | to separate the two users in the code below. Worth a try! Good luck
{MEL_SEND_FLAG("Flag","cmahon | jthomas","Normal",Subtractdates(ADDDATES(str(._TODAYSDATE), "0", "", "2"),"0","0","14"), "Anesthesia Endoscopy Form", "Patient "+PATIENT.LABELNAME+" has a BMI > 35 and is considering undergoing a procedure. Please assess.","Summary","")}