The following information is relevant for Orgs that use Salesforce Classic.
The following applies to CustomListRelatedRecordArchivedWidget and the CustomSingleRelatedRecordArchivedWidget.
From Package 21 onward, the Preview Table feature from the New Archive Policy form no longer controls the root layout setting. (deprecated). The RelatedRecordArchivedWidget is not customizable. We recommend using the two above-mentioned widgets. However, all steps are defined below.
These steps are only required if you create a widget for objects not included in the managed package. If irrelevant to your setup, you may skip this step.
1. At the top-right of the page, click the Settings icon to open the drop-down menu, and select Setup.
2. Filter by entering Visualforce Pages in the Quick Find.
3. Click New.
4. In the Page Information section, create a new Visualforce page, and name it appropriately to reference the specific object (with no spaces).
5. In the Visual Markup section, insert the following code into the body:
For CustomListRelatedRecordArchivedWidget:
<apex:page standardController="Account"> <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:customRelatedListResults"; $Lightning.use(lwcArchiverApp, function () { $Lightning.createComponent(widgetComp, { recordId: "{!Account.Id}", objectApiName: "Account", defaultObjects:["Case","Task","ContentDocument","Opportunity"] }, "lightning", function (cmp) { } ); }); </script> </apex:page>
For CustomSingleRelatedRecordArchivedWidget:
<apex:page standardController="Account"> <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: "{!Account.Id}", objectApiName: "Account", defaultChildObject:"Case" }, "lightning", function (cmp) { } ); }); </script> </apex:page>
For RelatedRecordArchivedWidget *(supported up to version 21):
<apex:page showHeader="false" standardController="Account" docType="html-5.0" > <OB_Archiver:SearchResultWidget recordId="{!Account.Id}" object="Account"> </OB_Archiver:SearchResultWidget> </apex:page>
6. Replace the marked parentObject to be the object of the Visualforce page.
7. Click Save.
Open the object layout page in the Setup and click Edit Layout.
Create a new section in the object layout.
Select the Visualforce page from the components option.
Complete the Section Properties adding either the CustomListRelatedRecordArchivedWidget and/or CustomSingleRelatedRecord Archived Widget
Enter a Section Name.
Check the Detail Page checkbox, and select 1-Column
Drag the Own page to the new section.
Click the Visualforce page properties button:
Set the Height to 500
Enable the Show scrollbars option.
Save the page layout. The new widgets are displayed.