createAttachment
Uploads a file into Salesforce as an Attachment record and attaches it to the specified record.
Only records of certain object types can have Attachments, so the parentId
attribute must specify the ID of a record of the following types:
Account
Asset
Campaign
Case
Contact
Contract
Custom objects
EmailMessage
EmailTemplate
Event
Lead
Opportunity
Product2
Solution
Task
Note that Salesforce itself appears to moving away Attachment records, promoting use of ContentDocument/ContentVersion records aka. "Files" instead. Please consider using the createContentVersion command with the linkToId
attribute defined instead of this command if you do not specifically need Attachment records.
Attributes
doc | ||
---|---|---|
Required | Value type | EL-evaluated |
No | File | Yes |
Defines the file whose data is included in the Attachment record. If not defined, the currently running Dynamo template becomes the attachment data. |
parentId | ||
---|---|---|
Required | Value type | EL-evaluated |
Yes | String | Yes |
Defines the record to which the new Attachment is attached to. The resolved String should be the ID of the target record. |
name | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | Yes |
Defines the name of the Attachment. If not defined, the Attachment will take the name of the currently running Dynamo template. |
isPrivate | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | No |
Defines whether the created Attachment is set as private. If the resolved String is "true", the record is private, causing only the owner and administrators to be able to view the Attachment. If the resolved String is anything else, or this attribute is undefined, all otherwise-allowed users can view the Attachment. |
description | ||
---|---|---|
Required | Value type | EL-evaluated |
No | String | No |
The resolved value of this attribute is set as the Attachment's description. |