Skip to main content
Participant
February 15, 2019
Answered

Calculated field script does not always return correct value

  • February 15, 2019
  • 1 reply
  • 473 views

I have a simple addition calculation script to toal the RowTotal:

var proRatedPerDiem = this.getField("travel_prorated_perdiem1").value;

var lodging = this.getField("travel_lodging1").value;

var total = proRatedPerDiem + lodging ;

event.value = +total;

The "proRatedPerDiem" field is also a calculated field and when that changes, about 50% of the time, the RowTotal either does not change, or it comes up with some old value . 

I have run the javascript debugger and confirmed the script always runs, it just often doesn't return the correct value.

This is my first time working in Adobe.  Is there some weird caching or something? 

This topic has been closed for replies.
Correct answer Bernd Alheit

Check the field calculation order.

1 reply

Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
February 15, 2019

Check the field calculation order.

phatKiwiAuthor
Participant
February 15, 2019

Thanks Bernd, That was exactly it.