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
The_A-RodThe_A-Rod 

Web form - create Idea record but can't upload attachment

We are trying to create a form on our Intranet for people to submit Ideas, which creates an Idea record in Salesforce. It works great until we try to add the upload attachment functionality.

This is the problem line in the script
<label for="upload_file">Choose a file to upload: </label><input name="upload_file" id="upload_file" type="file" /><label class="error">Maximum 5MB</label><br />

The record gets created, but there's no attachment and the error in the logs is
"ERROR uploading attachment to SFDC, file only saved locally"

Any ideas????

 
James LoghryJames Loghry
There's not much to go off here.  Can you provide additional code or any additional logs or errors that may be occurring?  When you submit the attachment, do you have a valid "WhatId" that relates to the Idea?   Otherwise, you would see an error like that.

Also, check that the Notes and Attachments related list is added to the Idea page layout, and that the proper permissions (Object CRUD and FLS) are set.