You need to sign in to do that
Don't have an account?

APEX Trigger on formula field
I have an apex trigger on a formula field. The formula field is coming from a parent object if that makes a difference.
Order of operations
users enter stuff on parent hits save.
User enters data on child hit save.
User then goes back to parent - hits a drop down selects submit
This provides the data in the formula field
I have a trigger if condition on the child formula field that says the below.
The problem I have found is it does do the logic I am stating unless the user edits the record and clicks save, or already has the parent value set to submit. What I want is as soon as the user enter the submit button the trigger fire on the child object. Please advise if you can
trigger ADRUserTrigger on ADRUser__c ( before update, before insert){
for (ADRUser__c a : Trigger.New) {
if (a.Next_Step2__c == 'Submit') {
update some records
}
Any help would be nice
Order of operations
users enter stuff on parent hits save.
User enters data on child hit save.
User then goes back to parent - hits a drop down selects submit
This provides the data in the formula field
I have a trigger if condition on the child formula field that says the below.
The problem I have found is it does do the logic I am stating unless the user edits the record and clicks save, or already has the parent value set to submit. What I want is as soon as the user enter the submit button the trigger fire on the child object. Please advise if you can
trigger ADRUserTrigger on ADRUser__c ( before update, before insert){
for (ADRUser__c a : Trigger.New) {
if (a.Next_Step2__c == 'Submit') {
update some records
}
Any help would be nice
In your current case when you are aware that the formula field would change due to certain activity on parent record, why not create a trigger on parent record as there is some DML action going and update related child records ?
Hope this helps !!