I have a custom object that has an ExternalId as one of the fields. Will Apex allow me to build a map with the external id as the key?
I tried the following code
Map<String,Asset_Plans__c> mapAssetSpecs = new Map<String, Asset_Plans__c>([Select AssetNumber__c, Id, Name FROM Asset_Plans__c WHERE AssetNumber IN ('123','245')]);
However this code doesn't change what is being stored in the key! I am still getting Id in the key.
The reason for this is I want to perform a lookup based on the AssetNumber__c column and get the Id of the record.