Expand my Community achievements bar.

SOLVED

How do I run an Exit event script upon a change in another field?

Avatar

Level 6

Good Afternoon,

I'm sure this is simple but I'm having a day. I have provided a link to the form that I'm asking about below. Under Classifications and Payroll Information, I would like to work with the following three fields in the table: Hourly Rate(hourlyRate), Hourly Rate Cap(hourlyRateCap), and Hourly Rate Used(hourlyRateUsed). My question is that if the user has the values entered but decides to change the hourlyRateCap and/or the hourlyRate, I need the hourlyRateUsed field to automatically run the exit event script in the hourlyRate field again to repopulate the correct value without the user having to click again on either of these fields. 

https://drive.google.com/drive/folders/1gNJSIUYdh-i-sR07mlwzOsl1Fv2jp-s4?usp=sharing

Thank you.

Emilee

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@nowackem 

You need to update the exit event of "hourlyRateCap" with the same script[0] to reset the values in case of any changes and NOT the change event.

I have updated the form and it works as per the instructions- https://drive.google.com/file/d/1oVWCDknyCNWwImMSOHKK0990-1O7ITzB/view?usp=sharing 

 

Please review the form and let me know.

Hope this helps.

 

[0]

if (this.resolveNode("hourlyRate").rawValue > this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRateCap").rawValue;
  }
  else if (this.resolveNode("hourlyRate").rawValue < this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRate").rawValue;
  }
  else if (this.resolveNode("hourlyRate").rawValue = this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRate").rawValue;
  }

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@nowackem 

You need to update the exit event of "hourlyRateCap" with the same script[0] to reset the values in case of any changes and NOT the change event.

I have updated the form and it works as per the instructions- https://drive.google.com/file/d/1oVWCDknyCNWwImMSOHKK0990-1O7ITzB/view?usp=sharing 

 

Please review the form and let me know.

Hope this helps.

 

[0]

if (this.resolveNode("hourlyRate").rawValue > this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRateCap").rawValue;
  }
  else if (this.resolveNode("hourlyRate").rawValue < this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRate").rawValue;
  }
  else if (this.resolveNode("hourlyRate").rawValue = this.resolveNode("hourlyRateCap").rawValue) {
  this.resolveNode("hourlyRateUsed").rawValue = this.resolveNode("hourlyRate").rawValue;
  }