UploadAttachment
Uploads an attachment and associates it with a specific Salesforce record.
Note: This procedure makes use of indexed parameters. Indexed parameters facilitate providing multiple instances a single parameter as inputs for the procedure.
Suppose there is an input parameter named Param#. To input multiple instances of an indexed parameter like this, execute:
EXEC ProcedureName Param#1 = "value1", Param#2 = "value2", Param#3 = "value3"
In the table below, indexed parameters are denoted with a '#' character at the end of their names.
Input
| Name | Type | Description |
| ObjectId# | String | The ID of the Salesforce object (such as an Account or Opportunity) to associate the uploaded file with. This field is required. |
| FullPath# | String | The full file path of the document to upload from your local system. Required if Base64Data is not provided. Only one of FullPath or FolderPath should be specified per upload. |
| Base64Data# | String | The full contents of the file, Base64-encoded. Required if FullPath is not provided. Useful for programmatic uploads without file system access. |
| FileName# | String | The name to assign to the uploaded attachment. Required if using Base64Data. If using FullPath, the file name will be derived automatically if this is left blank. |
| FolderPath# | String | Path to a folder containing multiple files to be batch uploaded. Either specify FolderPath or FullPath, not both. |
| LightningMode | String | Set to 'true' to upload files as 'Salesforce Files' instead of legacy Attachments. Required when working with Salesforce Lightning. FullPath must be specified when using this mode. |
| AttachmentTempTable | String | A temporary table containing multiple attachment records for batch uploading. Each row must include upload details such as ObjectId and FullPath or Base64Data. |
Result Set Columns
| Name | Type | Description |
| Id | String | The unique ID of the newly uploaded attachment in Salesforce. |