Hot answers tagged

1

The Map<Id, sObject> var = new Map<Id, sObject>(listOfsObject); (where sObject is any type of object, like Account or CustomObject__c) is semantically equal to: Map<Id, sObject> var = new Map<Id, sObject>(); for(sObject record: listOfsObject) { var.put(record.Id, record); } Note that you're not casting (explicit conversion from one ...


Only top voted, non community-wiki answers of a minimum length are eligible