Hi folks, this example will illustrate that how can we Upload Attachment to a Record (Account Record) in Visualforce Page and Apex The file that you upload using this will be available in the “Notes & Attachments” related list for the record.
Upload Attachment to a Record using Visualforce Page in Salesforce:
Step #1: Login to your Salesforce Account.
Step #2: Open Developer Console.
Step #3: Create a Apex class called AccountAttachmentHandler,
Step #4: Write the following code in the AccountAttachmentHandler class.
Step #5: Create a Visualforce Page called UploadAccountAttachment and write the following code.
Test Visualforce Page:
http://yoursalesforceinstance.com/apex/UploadAccountAttachment?id=0010H00002XidJk
Output:
The file that you upload using this will be available in the “Notes & Attachments” related list for the record.
View More:
- aura:unescapedHtml In Lightning Component Salesforce.
- What is Trigger Factory in Salesforce?
- Action Poller in Visualforce Pages Salesforce
- Action Poller in Visualforce Pages Salesforce.
Conclusion:
I hope you would like this post. Please don’t hesitate to comment for any technical help. Your suggestions and feedback are important to me.
Thank You.