function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ArmanArman 

Document fields in custom-objects

I'm trying to migrate some data from an existing db to Salesforce. I do this by creating Custom-Objects first. Within the existing tables there are document fields, but salesforce doesn't allow creating document fields (BLOB). Am I supposed to use the Documents object? or there is some other way of building a custom-object for documents and build relationships.

Any help is appreciated.
DevAngelDevAngel
Hi Arman,

Although slightly different in terms of maximum size, custom objects can have a related list of attachments.  You can use attachments in a similar way to documents as far as the API is concerned.  A custom object can have n attachments that will be associated with each record.  All you need to do to leverage attachments is select a check box when creating the custom object.

Cheers
ArmanArman
Thanks for your reply, it works really well.

Is it possible to access the attachment through a URL. I'm trying to work with the AppExchange API and I need the attachments table for my query but I need to access it's content (the real attachment) throught a URL from outsite.

What is the best way of doing this?
ArmanArman
I figured a way for building the url throught the relationship between the ownerid an attachment record and the actual custom-object record id. It seems to work fine when there is a current session, except when there isn't a session I can't get the content (images). How can I make attachments available for public access without a session?