How can I copy (duplicate) an attachment via a flowchart or workflow, without keeping the same ID when copying it to another record?
Duplicate attachment to another record
Collapse
X
-
You need to create a new Attachment record with 'sourceId' set to the sourceId of the Attachment record you copy or the id of the sourceId is empty.
Code:$sourceId = $attachmentAttributes['sourceId'] ?? $attachmentAttributes['id'];
If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.
Comment