If I have an instance of an Id variable that has been populated with a value, is there way to infer the sObject type of that Id using a describe call.
So if I did:
Set<id> parentIds = new Set<id>();
for (Attachment a : Trigger.new){
parentIds.add(a.ParentId);
}
//and here, I want to find out what are the parent records of these attachments.
Presuming all ParentId values are identical sObject types, is there anything I can do to check this?
And a follow-on: Can I infer sObject type from Id instance at all? Seems that could be handy at times.