You need to sign in to do that
Don't have an account?
Rohit Vaidya 3
flows and triggers
can we write half of the logic using apex triggers and half using flows, if yes then how can we achieve that and will it impact the performance and complexity?
Based on my understanding, yes, you can write half of the logic using Apex triggers and half using flows in Salesforce.
1. Create an Apex trigger that performs the initial logic.
2. In the Apex trigger, call a flow.(See Calling Flow from Apex :https://andyinthecloud.com/2014/10/26/calling-flow-from-apex/)
3. In the flow, perform the remaining logic.
See related: https://salesforce.stackexchange.com/questions/352972/structural-question-record-triggered-flow-and-apex-trigger-together
https://www.crmscience.com/single-post/invoking-apex-with-flow-using-salesforce
Combining triggers and flows will increase the complexity of your implementation, If the flow is too complex, it can cause performance/maintenance problems. It's important to have a clear understanding of the logic and maintain consistency between the trigger and flow.
If this information helps, please mark the answer as best. Thank you
Yes, it is possible to divide the logic between Apex triggers and flows in Salesforce. This approach can be useful when you want to leverage the strengths of both technologies. Apex triggers offer greater flexibility and can handle complex business logic, while flows provide a declarative and visual way to design and automate processes.
For more detailed information, check out here
https://www.crmscience.com/single-post/invoking-apex-with-flow-using-salesforce#:~:text=Invoke%20Apex%20From%20Flow.&text=After%20collecting%20the%20data%20or,parameters%20as%20variables%20you%20defined.
I hope it will help!
Thanks.