I have made the integration process between salesforce and our external system. the idea is that all Lead Status Changes in Salesforce must be recorded in our External system. For sending data when the lead status changes, it has been implemented successfully, but I have problems if sending data via REST API fails, the Lead status in Salesforce must be returned to its previous value (Rollback). Currently, when sending data via REST API fails, the Lead Status in Salesforce is still changing and this raises the issue of data integration between Salesforce and our external systems.
the following is additional information that may help you understand my problem:
- I use the Future Method for sending data
- Future methods are called through the process builder to trigger the process. The criteria are simple, if the lead status changes is true, run the apex class for sending lead status to our external system
I have tried several ways, such as trying to update them through the process builder and creating triggers, but due to my lack of knowledge and experience, it hasn't worked.
Please help if anyone knows the best way and how to solve this problem.
This is my first experience doing a system integration with Salesforce, I really appreciate all your help.