Categories Salesforce
Convert 18-character Salesforce Id to a 15-character case-sensitive string
In Spring 21 release, Salesforce introduced new method in System.Id namespace to convert 18 charater id to 15 character.
String Id_15_char = '0D5B000001DVM9t';
String Id_18_char = '0D5B000001DVM9tkAh';
ID testId = Id_18_char;
System.assertEquals(testId.to15(), Id_15_char);
How to convert a 15-character Id to an 18-character Id using formula – https://help.salesforce.com/articleView?id=000324394&type=1&mode=1