function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mohit Srivastava 10Mohit Srivastava 10 

I am making a call to an external link from salesforce. Say the URL for it is xyz.pwc.com/aaaabbbbccccddddrrr. "aaaabbbbccccddddr" is 18 character long and while making the call "aaaabbbbccccddddrrr" is getting trimmed to 15 characters and call is failing

Naveen Rahul 26Naveen Rahul 26
To convert it to 18 digits you can simply set it to an Id type variable:

Id someId = '001J000001eun1Q';

Which will automatically convert it for you:

system.debug(someId); // 001J000001eun1QIAQ

Then you can simply call the getSObjectType() method on the Id variable which will return the object name:

Schema.SObjectType objectType = someId.getSObjectType();
system.debug(objectType); // Account

https://salesforce.stackexchange.com/questions/94080/how-to-get-an-18-digit-id-from-15-digit-id-using-soql
Mohit Srivastava 10Mohit Srivastava 10
aaaabbbbccccddddrrr is not an Id. its text which is the part of the URL. But salesforce is assuming it to be an Id and tructating it.