New answers tagged

0

I was able to resolve this but changing Content Type to 'application/pdf' instead to '.pdf' in the csv that i prepared to upload the attachments


0

You can create a script and execute it on developer console anonymous apex. List<Attachment> listAttachments = [SELECT Id, ParentId FROM Attachment WHERE ParentId = 'opportunityId']; delete listAttachments; NB: I suggest you to test it on sandbox first and dummy record to ensure it is working as you expect.


0

I found a way to insert ContentVersion and attach it to Record in one SOQL. <apex:page controller="ContentController"> <apex:form> <apex:inputFile value="{!file}" /> <apex:commandbutton action="{!upload}" value="Upload" /> </apex:form> </apex:page> Class: public class ContentController { ...


Top 50 recent answers are included