Skip to main content
N8-K
Participating Frequently
August 18, 2018
Answered

Assistance with app.alert oCheckbox Parameter

  • August 18, 2018
  • 1 reply
  • 657 views

I'm attempting to nest an if statement to display a validation alert and a secondary informational alert which works fine, but continually pops-up with each field calculation if true. I'm now trying to incorporate the oCheckbox parameter after reading THIS article; however, although it displays properly and though my hideWarning variable is accurately resetting to "true" once the oCheckbox is checked, it does not stop popping-up. Any ideas what I'm doing incorrectly? Any assistance is very much appreciated!

Here's a simplified version of what I'm attempting:

if (!isNaN(event.value) && event.value < 10) { // Test for field value is a number and less than 10

   app.alert("Value must be greater than 10",1,0); // Validation alert

   var hideWarning = false; // initialization

    // Display Alert if hideWarning is false

    if(hideWarning == false) { // Test to see if variable hideWarning is false

        var oCk = {bInitialValue:false, bAfterValue:true}; // Set checkbox state

        // Secondary Alert that I'd like to hide if the user checks the don't show box

        app.alert({cMsg:"This is a message",nIcon:1,nType:0,cTitle:"This is a message title",oCheckbox:oCk});

        // Set hideWarning state for next calculation

      hideWarning = oCk.bAfterValue;

    }

}

This topic has been closed for replies.
Correct answer Bernd Alheit

Remove the line:

var hideWarning = false;

Put this line at document level.

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
August 19, 2018

Remove the line:

var hideWarning = false;

Put this line at document level.

N8-K
N8-KAuthor
Participating Frequently
August 19, 2018

That did it! Thank you sir!