You need to sign in to do that
Don't have an account?
Thomasm
Code to edit a string
I have a customer field called Subject that i would like to have the informtion change from TT-ABS EE38877 Jessica Martin is Absent. 0 Present. JB1356 Evonik Labs PO146 T&m
to only show the name Jessica Martin
the name changes but the format is always the same. Any idea's where to begin
to only show the name Jessica Martin
the name changes but the format is always the same. Any idea's where to begin
NOTE: This code has not been tested and may contain typographical or logical errors.
I'd also recommend that you do more control testing to make sure you do not get an array out of bounds exception or an NPE.
All Answers
Query all the records with Subject__c=' TT-ABS EE38877 Jessica Martin is Absent. 0 Present. JB1356 Evonik Labs PO146 T&m' .Update this fields with 'Jessica Martin' in the retrieved CSV and update the records.
Important :
If this is what you were looking for then please mark it as a "SOLUTION" or You can Click on the "Like" Button if this was beneficial for you.
<Identifier> <Identifier> <Name> is Absent. <Number> Present. ...
If it will always be the third and fourth value in the string, you could do something like:
global class Paging_Test implements Messaging.InboundEmailHandler
{
global Messaging.InboundEmailResult handleInboundEmail(Messaging.InboundEmail email, Messaging.InboundEnvelope envelope)
{
Messaging.InboundEmailResult result = new Messaging.InboundEmailresult();
Pages__C sPages = new Pages__C();
sPages.Job__C = 'a013000000UHggN';
sPages.Employee_Name__C = email.plainTextBody;
insert sPages;
Return Result;
}
}
An email is sent with the body of the email that looks like
"TT-ABS EE38877 Jessica Martin is Absent. 0 Present. JB1356 Evonik Labs PO146 T&m"
this create the Page record but the field employee name (formaly subject) is
TT-ABS EE38877 Jessica Martin is Absent. 0 Present. JB1356 Evonik Labs PO146 T&m
and i would like to pull out all of the date except the name which for this one is Jessica Martin
NOTE: This code has not been tested and may contain typographical or logical errors.
I'd also recommend that you do more control testing to make sure you do not get an array out of bounds exception or an NPE.