I have two objects called Opportunity and Tournee, with a date field and date field is a formula field which subtracts 10 days from date field in Opportunity and the trigger create events based on this dates and shows them in a calendar. Now, what I found is Tournee trigger is not being called on its date formula field update. Now how do i create Tournee events based on its date field?
Formula fields aren't really being
updated per se, but instead, they are just evaluated when you perform a query against the record.
Because of this, if you have two objects A and B, and you have a cross-object formula field on object B that is referencing a field on object A. If you update a record A, you are probably expecting that the record B gets updated as well due to the cross-object formula field, however, this won't be the case. Instead, the record B will calculate the new formula value only when you query for the record, or simply open the record detail page.
Thus, if you want to fire a
trigger in this case on object B, the only option you have is to actually create a
trigger on object A, query for the related B records inside the object A's
trigger, and do whatever you need to do with those records.