You need to sign in to do that
Don't have an account?
lainchbury
Is a change of value in a formula field an UPDATE event?
Hi
I'm trying to create a trigger that fires when a formula field is updated.
My question is whether a formula field updating automatically (without the user entering the record and editing or saving) constitutes an UPDATE event that could fire a trigger?
Thanks,
Paul
Hi Paul,
This depends on what's in the formula.
I'm assuming that the formula field is either time-based or fetching some fields from other objects. (If not, then the formula will automatically get updated upon you querying if from the trigger after any update on the record itself).
In case 1, you could consider scheduling a time-based trigger at the time the object is created/updated. The execution moment for the time-based trigger would be the moment the formula result changes (assuming that you can predict that).
In case 2, you will have to base your trigger on the formula source field(s), so build a trigger on the other related object.
All Answers
Formula fields won't cause triggers to fire I'm afraid. AFAIR they are populated when they are retrieved from the database, rather than having values written to them every time.
Hi,
Tha formula field will be updated automatically during both insert and update.
Cheers
Bramha
Hi Paul,
This depends on what's in the formula.
I'm assuming that the formula field is either time-based or fetching some fields from other objects. (If not, then the formula will automatically get updated upon you querying if from the trigger after any update on the record itself).
In case 1, you could consider scheduling a time-based trigger at the time the object is created/updated. The execution moment for the time-based trigger would be the moment the formula result changes (assuming that you can predict that).
In case 2, you will have to base your trigger on the formula source field(s), so build a trigger on the other related object.
Hi
Formula field wont contain any values by it self. They will fetch the values every time we access them. As such there is no value stored in the field, so there will no trigger fired.
Instead you can write a trigger on change of the fields you are referring to in the formula.
Thanks & Regards
Santosh
Thanks for your help guys, I get it now.
Paul