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
sami amisami ami 

Email parsing

Hi,

 

I am trying to parse an email with some string methods.

My email looks something like this.

 

 

Case # 00001234 has been updated.

 

Status is changed to In progress from New.

 

----------------------------------------

 

 

----------------------------------------

 

 

 

I am trying to capture above part (Status is changed to In progress from New.)

How can I do that?Any help?

Arunkumar.RArunkumar.R

Hi Ramesh,

 

I think you are trying to parse Subject or Body of the Email in Email to Case.

 

Please use this trigger to achieve your task,

 

trigger emailtocase on Case (before insert,before update)

{

for(case CaseInst:trigger.new)

{

if((CaseInst.Description.containsIgnoreCase('Case # 00001234') )

{

CaseInst.status='New';

}

}

}

Where "Description" is the Field Name, when what you typed in subject of your mail it will be stored in this field.

 

Just Parse this Description using containsIgnoreCase technique.

 

Hope this may useful for you..

 

If you found this your desired solution mark this answer as Best solution, Don't forget to give KUDOS...

 

Thanks and Regards,

Arunkumar.R | Salesforce Certified Developer