Sample Code:
String a = '0013h00000SIc6uAAD';
Id i = Id.valueOf( a );
here String ‘a’ should be a valid record id. We cannot generate Salesforce Id using this method because Salesforce Id is system generated Id and it cannot be generated by us.
Sample Code:
String a = '0013h00000SIc6uAAD';
Id i = Id.valueOf( a );
here String ‘a’ should be a valid record id. We cannot generate Salesforce Id using this method because Salesforce Id is system generated Id and it cannot be generated by us.
You must be logged in to post a comment.
It is not working. Do you know any other method.
String 'a' should have valid record id.
Great Working:) (y)
String a = 'adfh123edrftghu789';
Id i = (Id) a;