• Alejandro Miranda
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi All,

I am having problems when I try to invoke a Flow with Apex. I'm having the next problem:

Constructor not defined: [Flow.Interview.Asociado_correo_secundario_al_EmailMessage].<Constructor>(Id)

This is the part of code:

  public void beforeInsert(SObject so) {
        Case cas = (Case)so;
        if(cas.Origin=='Email'){
            MainCaseAnalyzer mCA = new MainCaseAnalyzer();
            mCA.analyzeDescription(cas);  
            system.debug('CASO BEFORE INSERT: ' + cas); 
        }
        if(cas.Status=='Reasignado'){
            cas.CAS_CHK_CasoReasignado__c=true;
        }
        
        List<EmailMessage> emailMessageList = [SELECT id,parentId FROM EmailMessage WHERE parentId =: cas.id limit 1];
        Flow.Interview.Asociado_correo_secundario_al_EmailMessage flow = new        Flow.Interview.Asociado_correo_secundario_al_EmailMessage(emailMessageList[0].id);
        flow.start(); 
            
    }

Any idea how to do it?

Thanks in advance!
Hi All,

I am having problems when I try to invoke a Flow with Apex. I'm having the next problem:

Constructor not defined: [Flow.Interview.Asociado_correo_secundario_al_EmailMessage].<Constructor>(Id)

This is the part of code:

  public void beforeInsert(SObject so) {
        Case cas = (Case)so;
        if(cas.Origin=='Email'){
            MainCaseAnalyzer mCA = new MainCaseAnalyzer();
            mCA.analyzeDescription(cas);  
            system.debug('CASO BEFORE INSERT: ' + cas); 
        }
        if(cas.Status=='Reasignado'){
            cas.CAS_CHK_CasoReasignado__c=true;
        }
        
        List<EmailMessage> emailMessageList = [SELECT id,parentId FROM EmailMessage WHERE parentId =: cas.id limit 1];
        Flow.Interview.Asociado_correo_secundario_al_EmailMessage flow = new        Flow.Interview.Asociado_correo_secundario_al_EmailMessage(emailMessageList[0].id);
        flow.start(); 
            
    }

Any idea how to do it?

Thanks in advance!