Skip to content

rahulkotian/CaseThreadId

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Case Scenario

There are scenarios when you need a case thread id , either in your flow or in Apex. Currently you cannot use SOQL to get the case thread id. There are some workarounds as creating a formula but they are not reliable as can be seen in comments in this idea -> Open idea: https://success.salesforce.com/ideaView?id=08730000000XvdHAAS

Components

  1) Email Template:  Case_Thread_Id_Email_Template
  2) Apex class: EmailUtilityClass, EmailUtilityClassTest
  3) Flow: Test_Flow_for_case_thread_id

Solution description

By using a combination of email template and the "Messaging" class we can generate the case thread id based on incoming case id. There is a test flow and test class included to help understand the usage.

Deploy to Org

Do you want to try in your own org ?

Deploy to Salesforce

Screenshots

  1. Debug flow (Test_Flow_for_case_thread_id) by passing parameters : Debug flow

Email example

  1. Use anonymous window to run test code:

    List<EmailUtilityClass.CaseTemplate> caseTemplateList = new List<EmailUtilityClass.CaseTemplate>();
    EmailUtilityClass.CaseTemplate testCase = new EmailUtilityClass.CaseTemplate();
    testCase.caseId='5004100000WcHURAA3';
    caseTemplateList.add(testCase);
    System.debug('Case thread id :'+ EmailUtilityClass.getCaseThreadID(caseTemplateList));
    

Anonymous code

Anonymous code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages