How do I run an Exit event script upon a change in another field? | Community
Skip to main content
nowackem
Level 5
October 27, 2021
Solved

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

  • October 27, 2021
  • 1 reply
  • 751 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Pulkit_Jain_

@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;
  }

1 reply

Pulkit_Jain_
Adobe Employee
Pulkit_Jain_Adobe EmployeeAccepted solution
Adobe Employee
October 27, 2021

@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;
  }
nowackem
nowackemAuthor
Level 5
October 27, 2021

Thank you so much! Perfect!