Skip to main content
Participant
August 14, 2018
Answered

Validation Script On Calculated Field

  • August 14, 2018
  • 2 replies
  • 697 views

I have a field that totals a series of fields.  If the total plus another value of another field exceeds value of a third field than an alert message should be generated and the value be returned to 0.  The filed returns a false value whether the validation criteria is met or not.  Any assistance would be greatly appreciated!!!

var IDC0=Number(this.getField("IDC0").value);

var TA=Number(this.getField("TotalAward").value);

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

 
app.alert("Total of Direct and Indirect Costs Cannot Exceed the
Total Award");

   event.rc=false;

}

This topic has been closed for replies.
Correct answer try67

This line is a total mess:

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

Change it to:

if ((Number(event.value)+IDC0)>TA) {

2 replies

Participant
August 16, 2018

I'm a dumbass  

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
August 14, 2018

This line is a total mess:

if(((Number(event.value)+IDC0.valueAsString)>TA.valueAsString));{

Change it to:

if ((Number(event.value)+IDC0)>TA) {