Skip to main content
drslrb
Known Participant
March 6, 2024
Answered

PDF Script for a popup

  • March 6, 2024
  • 1 reply
  • 14140 views

Hi.  I have a PDF file that contains a really long script for a popup.  I know there's an easier way to write the script, but I'm just not sure how to write the simplified script.  If you press the buttons by the names, it gives you a popup of 2-3 items.  It works perfectly until I try to utilize the "Office Use Only" box at the bottom right of the pdf.  If info is added into the "Office Use Only" box for a given row at the top, it is supposed to give a different list of items in the popup when the button next to the name is pressed.   

 

Can you help with a simplier way to right the script?  I think I can't figure out the solution because the script is so, long?

 

 

This topic has been closed for replies.
Correct answer Nesa Nurani

For example, this part:

 

else if(units > 0 && insure == "CareSource" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
    "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "DentaQuest" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert( 
    "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "Envolve" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
     "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "GHP" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
     "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

 

Can be shortened like this:

 

else if(units > 0 && im1 != "Off" && row6 == "2" && rx6 != "" && (insure == "CareSource" || insure == "DentaQuest" || insure == "Envolve" || insure == "GHP")) {
    app.alert("Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100");
}

 

When you have the same alert for multiple conditions and mostly all conditions are the same except 'insure' in this case, put it inside parentheses and use || (or).

 

1 reply

Nesa Nurani
Community Expert
Nesa NuraniCommunity ExpertCorrect answer
Community Expert
March 6, 2024

For example, this part:

 

else if(units > 0 && insure == "CareSource" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
    "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "DentaQuest" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert( 
    "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "Envolve" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
     "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

else if(units > 0 && insure == "GHP" && im1 != "Off" && row6 == "2" && rx6 != "")
    app.alert(
     "Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100"
);

 

Can be shortened like this:

 

else if(units > 0 && im1 != "Off" && row6 == "2" && rx6 != "" && (insure == "CareSource" || insure == "DentaQuest" || insure == "Envolve" || insure == "GHP")) {
    app.alert("Patient: " + name + "\n D9248 1 qty $125 \n D9630 1 qty $100");
}

 

When you have the same alert for multiple conditions and mostly all conditions are the same except 'insure' in this case, put it inside parentheses and use || (or).

 

drslrb
drslrbAuthor
Known Participant
March 6, 2024

That helped.  Thank you!  I was able to figure the other solution with that.