+ Start a Discussion
SandrineSandrine 

Excute logic in before and after trigger during Record Update

Hello,

I have a field picklist with values 
custom_picklist__c
Value: ABC, CDB.

If the value ABC is clicked and clcked on Save button, i want to execute a trigger which will execute some logic

Question:
1) How can i execute the usecase ?
Detect =>the change of picklist to ABC, and click of Save button
Action 1=> i want to change a Technical field value (can i do it in is before)
Action 2=>call a API (shold i call in future method ?)

thank you for suggestion 
Best Answer chosen by Sandrine
Sunil RathoreSunil Rathore
Hi Sandrine,

With regards to your question:
Action 1=> I want to change a Technical field value (can I do it in is before)
Comment: 
Yes, any change/update on the same object can be made from before trigger event without using DML statement. 

Action 2=> call an API (should I call in a future method ?)
Comment:
Yes, it is mandatory
Please refer the below link for more details 
https://www.greytrix.com/blogs/salesforce/2014/10/30/invoke-future-methods-through-apex-trigger-for-web-service-callout/

Hope this will help you. If does then mark it as the best answer so it can also help others in the future.

Many Thanks,
Sunil Rathore