How to create a visualforce page for Attachments.expert?

Modified on Tue, 14 Jul, 2015 at 2:40 PM

  • VisualForce Page for a Standard Object:

The below example shows Visualforce page for Account Object.

    • To create a Visualforce page called Account_Attachments Goto :

    • Setup►Develop►Pages►New

    • Enter the name for the page as Account_Attachments and enter the following code in the page.Standard Object Page Code.png


                                                                                        Fig-10.1

In the above example parameters are described as follows-

    1. RecordId : RecordId parameter passes parent record id to the Attachments, under which attachments will be created. e.g. Account's Id in this case

    2. FolderPath : Folderpath will specify in which folder on storage server the file should be saved. This is configurable and you can also use any formula field to specify path of your choice based on the record

    3. LookupFieldName : LookupFieldName should be the API name of the lookup field on Attachment using which Attachment is related to the parent record, for which the Record Id is provided above


  • VisualForce Page for a Standard Object:

  • The below example shows Visualforce page for Review Object.

  • To create a Visualforce page called Review_Attachments Goto :

  • Setup►Develop►Pages►New

  • Enter the name for the page as Review_Attachments and enter the following code in the page.

 





 

Fig-10.2

In the above example parameters are described as follows-

RecordId : RecordId parameter passes parent record id to the Attachments, under which attachments will be created. e.g. Review Id in this case

FolderPath : Folderpath will specify in which folder on storage server the file should be saved. This is configurable and you can also use any formula field to specify path of your choice based on the record

LookupFieldName : LookupFieldName should be the API name of the lookup field on Attachment using which Attachment is related to the parent record, for which the Record Id is provided above

 


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article