You need to sign in to do that
Don't have an account?
Leonard
Attachments on Custom Objects
How can I get / set an attachment to a Custom Object? When I inspect my Custom Object, I don't see an Attachment property. I've tried multiple queries with no success.
Attachments contain references to the object that they are attached to, rather than the object have a reference top its attachment.
The attachment object has a parentid field, which is the id of the object it is attached to.
That's because the relationship is from attachment to the object, rather than the other way around, as objects can have any number of attachments. Thus you have to query to retrieve all attachments like so:
[SELECT Id, Name FROM Attachment WHERE ParentId=:mycustomobject.Id]
where mycustomobject is the instance of your custom object.
Bob,
Thanks for the tips. Can you assist a little further?
I want to record the Attachment ID's discovered in a custom object so that I can easily perform some later post processing. How do I get the custom object created with one of the fields defined as the Attachment ID?
When I try to create the field the Attachment object is not listed as one of the choices.
I appreciate any advice you might offer.