function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bryan Revelant 7Bryan Revelant 7 

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


Ramu_SFDCRamu_SFDC
Unfortunately, formula field value change will not execute trigger as per the standard functionality of salesforce. The below discussion thread talks about the same http://salesforce.stackexchange.com/questions/28276/formula-field-change-doesnt-cause-trigger-fire

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 !!
Bryan Revelant 7Bryan Revelant 7
That most likely will work. The formula was on a picklist