Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

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

nowackem
Level 4
Level 4

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
PulkitJain
Correct answer by
Employee
Employee

@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
PulkitJain
Correct answer by
Employee
Employee

@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