Good afternoon,
I thought this was something I knew how to do, but I've forgotten how to disable an Action Button using VFE once it has been pressed. I have a RUNPROCESS button set to ADD_ORDER, and once the order is added by pressing the button, I want to disable the button so the order is only added one time. Any help is much appreciated!! Thanks,
Pat Apanasewicz
GI Associates, LLC
On the advanced tab of the action button you need to add an enable expression, so you could do it two ways
1) match(ORDERS_AFTER(),"Order Description")<1
or
2) Add to the code panel
{!document.button_clicked}
Add to the RUNPROCESS
{document.button_clicked = "Y"}
Add to enable expression
{document.button_clicked == ""}
The enable expression will make the button active if the condition is true
Thanks Michael! I thought that was what I tried, but perhaps my syntax was off. I would grey out the button, but it was ALWAYS greyed out, so I must have typed something wrong. Thank you so much for your help!
Pat
Using this same logic, I am trying to have a popup if a button is NOT pushed. If the button is clicked, then I do not want the yes/no popup to come up.
Using the page close handler, the popup is coming under both button clicked and button not clicked conditions. I am sure I have something rather simple wrong. Any help is welcome.
I have the following:
Add to the code panel:
{!document.button_clicked}
Add to the RUNPROCESS:
{document.button_clicked = "Y"}
Page Close Handler:
If
(LASTOBSVALUE("INS COVR TYP")=="Medicare") and DOUCMENT.button_clicked == ""
then
if
USERYESNO("You have not pushed orders!!!! Do you want to close the form?")=="No"
then
CLOSEPAGE("FALSE")
else
CLOSPAGE("TRUE")
endif
endif
aheideman said:
Using this same logic, I am trying to have a popup if a button is NOT pushed. If the button is clicked, then I do not want the yes/no popup to come up.
Using the page close handler, the popup is coming under both button clicked and button not clicked conditions. I am sure I have something rather simple wrong. Any help is welcome.
I have the following:
Add to the code panel:
{!document.button_clicked}
Add to the RUNPROCESS:
{document.button_clicked = "Y"}
Page Close Handler:
If
(LASTOBSVALUE("INS COVR TYP")=="Medicare") and DOUCMENT.button_clicked == ""
then
if
USERYESNO("You have not pushed orders!!!! Do you want to close the form?")=="No"
then
CLOSEPAGE("FALSE")
else
CLOSPAGE("TRUE")
endif
endif
A couple things I noticed in your code that could be causing issues:
1. DOCUMENT is spelled DOUCMENT in first IF statement
2. The second CLOSEPAGE statement is misspelled CLOSPAGE
3. According to the CPS Help file, when running CLOSEPAGE, the value of TRUE/FALSE should not be quotes. I'm not sure if the quotes will cause an issue, but it is something to consider.
So apparently I had numerous things wrong LOL.
I fixed the things that you pointed out and it still did not work.
However, removing the curly braces around {document.button_clicked = "Y"} in the Run Process window made it work.
Thanks for your help.