April 25, 201312 yr Is is possible to have a script trigger when the value of a calculation field changes?
April 25, 201312 yr No. However, it is possible to trigger a script when one of the fields referenced by the calculation field changes, if that change happens through a field on a layout. Can you explain any more details of what you're trying to accomplish?
April 25, 201312 yr Author I'm working in an order record. I have a text field called 'Pay Status'. I have a calculation field called 'Amount Due'. When amount due equals 0 I'd like to run a script to set 'Pay Status' to 0. I have the script triggered by the 'Amount Paid' field, which is a number field. However, there are some instances when no pay is required for an order (comps, replacements, etc). In these instances, I don't want the 'Pay Status' to remain as 'Unpaid'. I would like to have the script triggered as well. However, since the 'Amount Paid' field is never activated, the script doesn't trigger. I'd like to avoid layout script trigger work arounds.
April 25, 201312 yr You can do that with an auto-enter calculation. Give your "Pay Status" field an auto-enter calculation like this: If ( "Amount Due" = 0 ; 0 ; /* Else */ Self ) ... and set the auto-enter to replace the existing value in the field. You may encounter some refreshing problems if the "Amount Due" calculation is based on fields in other tables, in which case you should consider attaching script triggers to the other fields used by "Amount Due" in addition to "Amount Paid". Script triggers attached to layouts and layout objects are not "work arounds."
April 26, 201312 yr Author I was under the impression that an auto-enter calculation only triggers on record creation. Is this correct? Or can it be re-triggered? Can you explain your example more to me? Ideally, I'd like to have three statuses: Paid, Partial, Unpaid What I meant about the work around, is that I'd prefer to have the status field live update while users are working in the record and not have to rely on the layout exit or enter script trigger to set the status field.
April 26, 201312 yr I was under the impression that an auto-enter calculation only triggers on record creation. Is this correct? Or can it be re-triggered? Can you explain your example more to me? Depends on whether or not you deselect the button (after clicking ok) that reads "Do not replace exiting value (if any)
Create an account or sign in to comment