Skip to main content
Known Participant
March 20, 2018
Answered

add popup message to currant script

  • March 20, 2018
  • 2 replies
  • 713 views

hi, i'm using bellow script with drop down field. what i want to do is, if select "SGD" in drop down, fields "EX" value should be empty. if select any other value in drop down, need to popup message "Please fill exchange rate". ps help me to edit bellow script. thanks in advance. thanks..

var sNewSel = event.value;

switch (sNewSel) {

  case "SGD":

    this.getField("EX").value = "";

}

This topic has been closed for replies.
Correct answer try67

thanks a lot & it's working perfectly.. i just want add another condition into it so pls help me.

if select anything other than "SGD" & field "EX" is empty then only need to popup that message.

if fields "EX" already available values then no need that popup massage. thanks..


Add this if-condition before the alert:

if (this.getField("EX").valueAsString=="")

     app.alert("Please fill exchange rate");

2 replies

omanbuxAuthor
Known Participant
March 20, 2018

hi, thanks a lot. can u pls give me the compete code inserting your code. thanks in advance.

try67
Community Expert
Community Expert
March 20, 2018

I forgot to mention that you also need to add a "break" command... Here's the full code:

var sNewSel = event.value;

switch (sNewSel) {

    case "SGD":

        this.getField("EX").value = "";

        break;

    default:

        app.alert("Please fill exchange rate");

}

omanbuxAuthor
Known Participant
March 20, 2018

thanks a lot & it's working perfectly.. i just want add another condition into it so pls help me.

if select anything other than "SGD" & field "EX" is empty then only need to popup that message.

if fields "EX" already available values then no need that popup massage. thanks..

try67
Community Expert
Community Expert
March 20, 2018

Add this to the switch statement:

default: app.alert("Please fill exchange rate");