Salesforce Configuration
User can enable attachments.expert on most standard or all custom object of his choice if lookup of that object can be created on Attachment object of Attachments Expert
Enable Attachments Expert on standard object:
Please follow the steps below to setup attachments.expert on a Standard Object (eg. We will enable attachments.expert for Account object)
Create a lookup field called ’Account’ on Object ’Attachment'
Setup ->Create-> Objects ->Attachment ->New Custom Field ->Lookup
Create a lookup field called ’Account’ on Object ‘Folder’
Setup ->Create-> Objects ->Folder ->New Custom Field ->Lookup
Now create a Visualforce page called Account_Attachments and Add following code to the Visualforce page
Setup-> Develop ->Pages ->New
<apex:page showheader="false" docType="html-5.0" standardController="Account" > <c:AttachmentsExpert RecordId="!account.Id" FolderPath="!account.Name" LookupFieldName="ATT_EXP_Account_c"/></apex:page>
RecordId: RecordId parameter passes parent record id to the Attachments, under which attachments will be created. E.g. Account’s 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 and Folder using which Attachment and Folder are related to the parent record, for which the Record Id is provided above
Now add this page to the layout of the Account object
Steps to Add Attachments Expert VisualForce Page to Account object layout:
In your Salesforce account, Click on the ‘Setup’ link and then select the Salesforce object page layout for which you want to use Attachments Expert. Refer the mentioned example on Account object
Go to the Visualforce pages section and add Attachments Expert page to the Account layout
Save the page layout. Now you are ready to use the Attachments Expert for that object
Salesforce ConfigurationNow you can go to any account which has the above layout displayed and start using attachments.expert
When the user installs the Package then by default Attachment Section get enabled on Account object of their instance. It can be enabled on other Standard or Custom Object following the above example
Enable Attachments.expert on custom object:
Please follow the steps below to setup attachments.expert on a Standard Object (eg. We will enable attachments.expert for Account object)
Create a lookup field called ’Review’ on Object ’Attachment'
Setup ->Create-> Objects ->Attachment ->New Custom Field ->Lookup
Create a lookup field called ’Review’ on Object ‘Folder’
Setup ->Create-> Objects ->Folder ->New Custom Field ->Lookup
Now create a Visualforce page called Review_Attachments and Add following code to the Visualforce page
RecordId: RecordId parameter passes parent record id to the Attachments, under which attachments will be created. E.g. Account’s 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 and Folder using which Attachment and Folder are related to the parent record, for which the Record Id is provided above
Now add this page to the layout of the Review object
Steps to Add Attachments Expert VisualForce Page to Review object layout:
In your Salesforce account, Click on the ‘Setup’ link and then select the Salesforce object page layout for which you want to use Attachments Expert. Refer the mentioned example on Account object
Go to the Visualforce pages section and add Attachments Expert page to the Account layout
Save the page layout. Now you are ready to use the Attachments Expert for that object