Skip to main content
Participant
March 21, 2023
Question

Custom Adobe Script Not Working

  • March 21, 2023
  • 1 reply
  • 1158 views

Hi, this is the first time that I have attempted to write a custom java script and something isn't working right.

I need to calculate one filed * 600, and this is what I have so far:  event.value = Number(this.getField("# of Wells").value*600).value;

 

Data is not showing up and I'm not sure if my script is even working.

 

Also I have another field that isn't working.  There is no data and I'm not sure if the script is working:  I need the different from "Total New..." and "Previous...":  var nDiff = this.getField("Total New Annual Rental").value=this.getField("PreviousRental").value-("PreviousRental");

 

 

Any assistance you can provide would be greatly appreciated.

 

 

 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 21, 2023

1. Use this:

event.value = Number(this.getField("# of Wells").value)*600;

2. Use this:

event.value = Number(this.getField("Total New Annual Rental").value)-Number(this.getField("PreviousRental").value);

 

Edited: Your field names were not clear in #2... I hope I got it right.

 

Participant
March 21, 2023

Thank you, but for some reason the field is still blank:

 

 

I also had another example of an issue.  I think you did ask about my field names, they are "# of wells" and the output is "Additional Well Payment"

 

 

try67
Community Expert
Community Expert
March 21, 2023

JS is case-sensitive, so if the field is called "# of wells" it must appear like that in the code, not as "# of Wells"... An error message saying getField returned null should have appeared in the JS Console. Did you check it?