Skip to main content
Hi there,

 

Is there a way to extract, display and send in an email a 18 Character SFID for the Account?

 

I know that if we run a Query using APEX Explorer 8 , I will be able to get the 18 Character SFID.

 

But my question is - If I need to send this information in an Email to a Contact, how will I do it?

 

What kind of Template can I design, which can extract 18 Character SFID and display in an email message and send it across to the user?

 

In an HTML Template , I used the merged fields, and it DOES send the Account ID and Contact ID in an email message. Like this:-

 

Salesforce Account ID: {!Account.Id

Salesforce Contact ID: {!Contact.Id}

But, the merge fields do not extract the 18 digit, what can I do here to extract the full 18 character and send it across to another user.

 

Please advice.

 

Thanks.

 

8 answers
  1. Nov 6, 2012, 6:16 PM
    i already resolved this by creating a Formula(Text) field and then calling it in on the email template. The formula field to extract the 18 digit was as follows:-

     

    Id

     

    & MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(

     

    IF(FIND(MID(Id,1,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)

     

    +IF(FIND(MID(Id,2,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)

     

    +IF(FIND(MID(Id,3,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)

     

    +IF(FIND(MID(Id,4,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)

     

    +IF(FIND(MID(Id,5,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)

     

    )+1,1)

     

    & MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(

     

    IF(FIND(MID(Id,6,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)

     

    +IF(FIND(MID(Id,7,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)

     

    +IF(FIND(MID(Id,8,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)

     

    +IF(FIND(MID(Id,9,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)

     

    +IF(FIND(MID(Id,10,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)

     

    )+1,1)

     

    & MID("ABCDEFGHIJKLMNOPQRSTUVWXYZ012345",(

     

    IF(FIND(MID(Id,11,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,1,0)

     

    +IF(FIND(MID(Id,12,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,2,0)

     

    +IF(FIND(MID(Id,13,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,4,0)

     

    +IF(FIND(MID(Id,14,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,8,0)

     

    +IF(FIND(MID(Id,15,1), "ABCDEFGHIJKLMNOPQRSTUVWXYZ")>0,16,0)

     

    )+1,1)

     

    hope this helps everyone.

     

    thanks.
0/9000