Activity Forums Salesforce® Discussions How can I convert a 15 char Id value into an 18 char Id value?

  • PRANAV

    Member
    August 26, 2016 at 10:48 am

    Hi Tanu,

    1. Separate the 15 char Id (0012800000h7EFK)into 3 groups of 5 chars. You now have 3 strings (the triplet variable below): 00128, 00000 and h7EFK.
    2. Reverse each string. The three strings are now 82100, 00000 and KFE7h.
    3. In each string, convert all Uppercase chars to 1, all other chars to 0. The three strings are now 00000, 00000 and 11100.
    4. Look up the corresponding char in the BinaryIdLookup based. This gives us a suffix of AA2.
      The 3 chars generated (in order) are appended to the 15 char Id value, giving you an 18 char Id value of 0012800000h7EFKAA2.

    Hope this helps you.

  • Sneha

    Member
    June 14, 2017 at 8:33 am

    What is BinaryIdLookup? Can you please let me know how to look up the corresponding char in the BinaryIdLookup based?

    Thanks,

    Sneha

  • Raj

    Member
    July 13, 2017 at 11:41 am

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos