function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RomyRomy 

Prevent Before Update trigger from firing when case is created through on demand email to case

I have created an on demand Email to Case that that creates a new case. It fires before insert trigger on case  to auto populate some fields depending on the case record type in the On demand email to case. This is ok..and according to what I need. However, Problem is -- it is also firing the before update triggers...Which It should not. This trigger didn't fire ...when the case is created mannually.

 

Can some one suggest how to prevent firing of before update trigger when the case is created for the first time by Email to case ??? I am using proper Trigger.Isbefore conditions

 

I am using Assignment rules that that transfer the Case to proper queues depending on the case record types.....Is this before update trigger gets fired because of these Assignment Rules as they are changing the Case Owner to Queue ?

 

Who will be the Owner of Case before they are assigned to queue.....and How to check them through some If condition that I can include in this trigger so that it will not fire at the time of case creation through Email to Case.

 

Any help will be appretiated

mikefmikef

Romy:

 

Please post your trigger using the code insert icon.

But without seeing your trigger my guess is you just need to use the Trigger.isInsert to check if you are in the insert or the update.

 

if(Trigger.isInsert){ //do something. }