I am looking for advice on the best direction to go in.
A little background:
On a custom page a user can generate a report. Every time a report is generated, a unique PDF is saved into document storage. My task: I need to take this PDF and add it to the Attachment object. What is the best way of going about this? Is there a way to do this without using dataloader? My thought was to create a new attachment and update the field values:
Attachment att = new Attachment(); att.Name = BVS__c.CompanyName__c; att.Body = BVS__c.Report__c; att.ParentId = Contact.Id; insert att;
But I am getting rejected from doing so. Is this possible? Or is it better to go with DataLoader?