Skip to main content
Inspiring
August 21, 2018
Answered

Add another value to my custom calculation script

  • August 21, 2018
  • 1 reply
  • 1104 views

This works when I add the following script to the Custom Calculation in the 'JobType' text field, I type Regular in my 'Status' Text Field the number 1 shows up in 'Job Type' text field.

The problem is I also need to be able to type Temp so the number 2 shows up, but when I try to add it and and I type Regular in the 'Status' field 2 shows up in 'Job Type', not 1.  I've tried everything and it's probably so simple

var a ="";

     if (this.getField("Status").value == "Regular"){

     a="1";

     }

     event.value = a;

This topic has been closed for replies.
Correct answer try67

Use this code:

var a ="";

if (this.getField("Status").value == "Regular"){

    a="1";

} else if (this.getField("Status").value == "Temp"){

    a="2";

}

event.value = a;

1 reply

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

Use this code:

var a ="";

if (this.getField("Status").value == "Regular"){

    a="1";

} else if (this.getField("Status").value == "Temp"){

    a="2";

}

event.value = a;

Inspiring
August 21, 2018

You are truly awesome!!  Thank you so much!!