This question already has an answer here:
I have an 18 character Salesforce ID:
When it's used in an SOQL query:
Id recordId = Id.valueOf('XXXXJ00000326hjQAA'); List<Opportunity> records = [SELECT ID FROM Opportunity WHERE ID = :recordId]; System.debug(records.size());
But when the 18 character Salesforce ID is all upper case:
I thought 18 character Salesforce ID's were case-insensitive.
Why is it not returning a record?