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
MigMig 

Apex trigger do not fires in a Email-to-case

I've created a trigger in the Case Object but it does not fires when my salesforce receive a case from a email to case ...
Is there a way to enable/disable the apex code triggers from outside rssources ?

does the Apex triggers works  with email to cases and webtocases and all this kind of external sources  ??

Thankx 

Miguel


Message Edited by Mig on 06-27-2008 04:57 PM
jamesmulcahyjamesmulcahy
I'm also seeing this behaviour.  I've got some APEX triggers configured to copy fields across from an account to a case, and I can't get these to fire for cases created by E2C.

Did you ever find a solution to this, or does anyone know if this is a known limitation? I can't see it mentioned anywhere in the documentation.
SunkannaKuruvaSunkannaKuruva
Hello am also facing same problem my trigger is working for account data updation but not working for owner change 

below is the my trigger code 
public static void afterInsertlss(list<case> cases){
         list<case> allCases=new list<case>();
         set<String> goldids=new set<String>();
         id qid=[select queue.Id from queueSobject where queue.Name='LSSGOV'].queue.Id;
             for(Case c:cases){
                 if(c.Origin == 'Email' && c.recordtypeid==Schema.Sobjecttype.case.getRecordTypeInfosByName().get('LSS Governance Cases').getRecordTypeId()){   
                        goldids.add(c.subject.substringAfter('GoldId:'));
                        allCases.add(c);
                 }
             }
             
             map<String,Account> accMap=new map<String,Account>();
                 for(Account acc:[select id,GE_HQ_Gold_ID__c,Jurisdiction__c from Account where GE_HQ_Gold_ID__c=:goldids]){
                     accMap.put(acc.GE_HQ_Gold_ID__c,acc);
                 }         
             map<String,id> lssrMap=new map<String,id>();
                 for(LssRouting__c lr:[select id,name,User_SSO__c from LssRouting__c where name=:goldids]){
                     lssrMap.put(lr.name,lr.User_SSO__c);
                 }
            list<case> updateCases=new list<case>();
            for(Case cs:allCases){
                case c=new case();
                c.id=cs.id;
                if(accMap.size()>0 && accMap.containsKey(cs.subject.substringAfter('GoldId:'))){                   
                       c.accountid = accMap.get(cs.subject.substringAfter('GoldId:')).id;
                       c.gold_id__c = accMap.get(cs.subject.substringAfter('GoldId:')).GE_HQ_Gold_ID__c;                       
                       system.debug('##############1 '+c.ownerid);
                       if(lssrMap.containsKey(cs.subject.substringAfter('GoldId:')) && lssrMap.size()>0){
                           system.debug('##############2 '+c.ownerid);
                           c.ownerid='005G0000005ALh0';//lssrMap.get(cs.subject.substringAfter('GoldId:'));                   
                       }
                       else{
                           c.ownerid=qid;
                       }
                    }
                    else{
                        c.ownerid=qid;
                    }
                updateCases.add(c);
            }        
        update updateCases;        
    }

if you guys found solution can you please share with me also.

thasnk,
Sunkanna