Configure a Visualforce page that displays email messages alongside their related
archived Content Documents within the CustomListRelatedRecordArchivedWidget
and CustomSingleRelatedRecordArchivedWidget in the Archive managed
package.
Note This content relates to Archive. For Salesforce Archive, see Store Data Externally with Salesforce
Archive.
The instructions apply to both Salesforce Classic and Lightning Experience.
Note
You must have access to Visualforce pages.
-
Create a Visualforce Page.
- Click New to create a Visualforce page for the selected email object.
-
Enter a Label for the page.
Example:
archiverecords_for_email_message -
Enter a Name.
Use underscores instead of spaces.
Example:
archiverecords_for_email_message -
In the Visualforce Markup section, enter this code.
<apex:page standardController="EmailMessage"> <apex:includeLightning /> <div id="lightning" /> <div id="showErrornotSuported"></div> <style> lightning-breadcrumb.slds-breadcrumb__item { text-align: center !important; } .toastModel { height: 4rem !important; position: fixed !important; top: 0rem !important; left: 50% !important; transform: translateX(-50%) !important; z-index: 100000 !important; } </style> <script> let lwcArchiverApp = "OB_Archiver:lwcWrapperAppForVisualforce"; let widgetComp = "OB_Archiver:CustomRelatedSingleResults"; $Lightning.use(lwcArchiverApp, function () { $Lightning.createComponent(widgetComp, { recordId: "{!<a href="http://EmailMessage.Id" rel="noopener" target="_blank">EmailMessage.Id</a>}", objectApiName: "EmailMessage", defaultChildObject: "ContentDocument" }, "lightning", function (cmp) { } ); }); </script> </apex:page> - Click Save.
-
Add the widget to the Page Layout in Salesforce Classic.
- In Setup, go to the object's layout and click Edit Layout.
- Create a section in the object layout.
- From the Components menu, select the Visualforce Page option.
-
In Section Properties, select either
CustomListRelatedRecordArchivedWidgetorCustomSingleRelatedRecordArchivedWidget, or both. - Enter a Section Name for the new section.
- Check the Detail Page checkbox and select 1-Column.
- Drag the page to the new section.
-
Click the Properties icon on the Visualforce page.
Set the Height to
500and turn on the Show Scrollbars option. -
Click Save.
The new widgets are now visible on the page layout.
-
Verify the Display
- Go to an EmailMessage record in Archive.
- The widget displaying the archived Content Document is now visible.
- The content of the archived document, fetched from Archive, appears under the Details tab.