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
Christopher DeFilippiChristopher DeFilippi 

BODY Field on Attachment

Hello,

I am using a third party (Qualtrics) to create an attachment on a SF record. Can the BODY field be a URL? If not, how can I accomplish this. The form maps the file URL to the BODY and NAME field.
James LoghryJames Loghry
Attachments are files related to an object, with a body stored as base64 data.  You could create a .html file with a link in it, and upload it as base64 data, but it'd make more sense to upload the data as a Note record instead.
UC InnovationUC Innovation
As James mentioned, the body needs to be base64.  As an alternative to James' suggestions, you can also try retrieving the file from the URL first and then assigning the file to the body field.  Not sure if Qualtrics supports that though.
Christopher DeFilippiChristopher DeFilippi
I encoded the url to base64 to see if it would pass through and it still couldn't. If I upload it using a note, I lose the attachment functionality. If I created an attachment object through visualforce, would BODY still be required?
UC InnovationUC Innovation
Yes, BODY would still be required:  https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_attachment.htm.

How are you creating the attachment record?  Is it within Qualtrics via SOAP or REST API?  Or somewhere else?