Skip to content

Instantly share code, notes, and snippets.

@lucasvalhos
Created June 8, 2022 13:26
Show Gist options
  • Save lucasvalhos/51ac9dbff1787da035e8f60c1ed9ecc8 to your computer and use it in GitHub Desktop.
Save lucasvalhos/51ac9dbff1787da035e8f60c1ed9ecc8 to your computer and use it in GitHub Desktop.
trigger TriggerAcaoDeMarketing on AcaoMarketing__c (before insert, before update) {
if(Trigger.isInsert && Trigger.isBefore){
// Valida o status
AcaoMarketingController.validaCriacaoStatus((List<AcaoMarketing__c>) Trigger.new);
}
if((Trigger.isInsert || Trigger.isUpdate) && Trigger.isBefore){
// Valida o status
AcaoMarketingController.validaTipoAcao((List<AcaoMarketing__c>) Trigger.new);
AcaoMarketingController.checarSeContatoAutorizouEnvioDeEmail((List<AcaoMarketing__c>) Trigger.new);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment