Reputation: 1615
I'm trying to script for a PDF using Adobe Acrobat DC (pro).
I have multiple field getting populated by calculating another field's data.
Whenever I change said field's data manually it works, but when I do it programmatically the other fields don't get updated.
Is there any way of triggering an event manually?
Upvotes: 2
Views: 1984
Reputation: 3615
It might be an idea to pack the script for that calculation into a function, and then call it from the according Calculate event, or, if programmatically, call it from the program code.
It is, however, best practice to consolidate all calculations into one single script/function, which is then triggered in the Calculate event of a hidden field which is not even part of the calculation. This works because any change of a field value triggers the field event sequence, where the Calculate event triggers the document calculation sequence (which executes all calculations in the Calculation Order of the fields containing a calculation).
BTW, this calculation order is the cause when a result is always one step behind; if that happens, either do as mentioned above (consolidate everything to one single script), or check the field calculation order.
Upvotes: 1