trigger TriggerAccount on Account (after insert, after update) {
if(Trigger.isAfter){
if(Trigger.isInsert || Trigger.isUpdate){
//calling helper class
TriggerHelper.accountTwitterRatingUpdate(Trigger.newMap, Trigger.oldMap);
}
}
}
Helper class
public with sharing class TriggerHelper {
//method called by account Trigger
public static void accountTwitterRatingUpdate(Map<Id, Account> mapAccount, Map<Id, Account> oldMapAccount) {
//set of accountId
Set<Id> accId = new Set<Id>();
//Iterating records
for(Account account : mapAccount.values()){
//YOUR LOGICS HERE
}
}
}
}
Happy that it helped you! If you feel that I was able to help you, could you please give me KUDO for this.
Regarding, above code snippet, it checks if probability is 100% and if didn't update. The check is there to make sure that if you edit record without updating probability field, same code snippet not run again and again without change in probability in case of update of record.
Let me know if you have any specific question about this.
Hi,
I assume 100% probability is treated as 1, so based upon that you can use below code skeleton:-
You can modifiy this code to meet your requirement.
Let me know if you have any specific question.
All Answers
Hi,
here is an example
Helper class
Hi,
I assume 100% probability is treated as 1, so based upon that you can use below code skeleton:-
You can modifiy this code to meet your requirement.
Let me know if you have any specific question.
Thanks !!!
Can you please tell me the script ??
Happy that it helped you! If you feel that I was able to help you, could you please give me KUDO for this.
Regarding, above code snippet, it checks if probability is 100% and if didn't update. The check is there to make sure that if you edit record without updating probability field, same code snippet not run again and again without change in probability in case of update of record.
Let me know if you have any specific question about this.
Happy to help you!
Thanks