Skip to main content
Hello

The Email to Case was enabled, the corresponding configurations were made, an email was already linked and the test of sending an email was made and it is received in Salesforce correctly, at the time of receiving the email create a case, a worflow was made to fill certain default fields when the case is created.

At the time of receiving the email, within the body of the email it contains specific information necessary, to be able to fill custom fields that were made corresponding to this information, but through the wf, process builder and flow I have not been able to make the information of the body of the email to these fields.

From what I've read, I think I have what to do through an apex to extract information from the body of the mail, but I have no idea or information on how to make the code in Apex, someone could give me ideas on how to do it apex?

Example of the mail that is received in Salesforce:

Hello,

Registration this ok, plataform: 

Credit Number: 221051400407

Account Name:  XXXYXXX Asignar Formalizador

Opportunity Name:  XXXYXXX Asignar Formalizador

Date Pay: 2021-05-14

Amount: $1

Aplication Pay : Reducción de mensualidad

Archive: Link
4 Antworten
  1. 24. Mai 2021, 14:41
    Hi

    The description data mapping, there was no need to do it with apex, through workflow and field update with different formulas, use MID, FIND, DATEVALUE, etc ..., depending on the data to extract from the description are the formulas that would be used

    Example:

    MID(Description, FIND("No. Crédito:", Description)+13,11)

    DATEVALUE(MID(Description, FIND("Fecha en que se hizo el pago:", Description)+30, 4) & "-" & MID(Description, FIND("Fecha en que se hizo el pago:", Description)+35, 2) & "-" & MID(Description, FIND("Fecha en que se hizo el pago:", Description)+38, 2))

    Thanks and Regards