Attachments and Files in Copado

Copado uses attachments to store information related to different features. Most of this attachments are created and updated automatically by Copado and you can just ignore them. In fact, most of the record pages in Copado will not show the Notes & Attachments related list therefore you won't see if there is any attachment being used by Copado.

However the behaviour in some feature can be modified or enhanced by adding specific attachments or modifying the existing ones created by Copado. If you read some documentation suggesting to modify or create new attachments, you need to consider the following.

An attachment in Salesforce can be of type "Attachment" or "File". Unless specified the opposite in the documentation, the attachment should be of type "Attachment" and not "File" but, if the attachment is uploaded from Lightning interface, it will be uploaded automatically as a File which will be invisible for Copado since we are looking for an "Attachment".

In this case, you can use the code below to insert the Attachment from the anonymous apex window in the developer console. 

Blob b = Blob.valueOf('Content of the attachment');

Attachment attachment = new Attachment();
attachment.ParentId = 'XXXXXXXXXXXXXXX';
// Note: ParentId is the Salesforce record Id where the attachment is going to be uploaded.
attachment.Name = 'AttachmentName';
attachment.Body = b;


How did we do?