You need to sign in to do that
Don't have an account?
Carolina W 2
Run Trigger only by Flow
I want to call a Before Update Trigger only when my Flow is running.
I created a checkbox field called "Run_code__c". The standard value is false.
My code:
But how can I change run_code__c to "true" in the flow if the trigger will block it?
There is another way to solve it?
My goal is to run the Trigger Before Upadate only when my Flow is running.
I created a checkbox field called "Run_code__c". The standard value is false.
My code:
for(Account acc:trigger.new){ if(acc.run_code__c){ //Do stuff } else { acc.addError('MsgError'); }
But how can I change run_code__c to "true" in the flow if the trigger will block it?
There is another way to solve it?
My goal is to run the Trigger Before Upadate only when my Flow is running.
Greetings!
When the record is updated by the automated user(fire/process) then there is a chance that the trigger will not fire.
So,you would need to use the apex class with @incovable method to achieve this requirement.Otherwise,you can refer the below thread for the suggestion:
https://salesforce.stackexchange.com/questions/333565/bypass-before-update-trigger
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
All Answers
Greetings!
When the record is updated by the automated user(fire/process) then there is a chance that the trigger will not fire.
So,you would need to use the apex class with @incovable method to achieve this requirement.Otherwise,you can refer the below thread for the suggestion:
https://salesforce.stackexchange.com/questions/333565/bypass-before-update-trigger
Kindly mark it as best answer if it helps so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Thanks, Shirisha!
U helped me a lot!
What I have done:
Class
TriggerP.s: I deleted "Run_code__c". I'm not using anymore.
Thanks!
So in the flow, before update the record, I put an Apex Action.