Home SALESFORCEAPEX How to convert from 18 Digit Salesforce ID to 15 Digit ID Using Apex Class

How to convert from 18 Digit Salesforce ID to 15 Digit ID Using Apex Class

Its possible to convert from 18 Digit Salesforce ID to 15 Digit ID Using String Function Called ‘Substring’ and see the below Example for your reference:

[code]
String AccountId = ‘00111000009lpABAAY’;
String Accountid15Digit = AccountId.substring(0, 15);
system.debug(’15 Digit Account ID”+ Accountid15Digit);
[code]

For More Details see the below Link:

http://www.salesforce.com/us/developer/docs/dbcom_apex250/Content/apex_methods_system_string.htm

You may also like

Leave a Comment