You need to sign in to do that
Don't have an account?
Michael S
Attachment parent type
How do I determine the type of an attachment's parent?
I know that I can call retrieve on all of referenceTo types in the type description, but is there an easier way?
Hi Michael,
In API 4.0 there is a new attribute on the describeSObjectResult called keyPrefix. This is a 3 character string that corresponds to the first 3 characters of an ID. What this means is that you can determine the type of object that the attachment parent is by examining the first 3 characters of the ParentId and matching it with a prefix from a specific object describe.