Create and show the CustomListRelatedRecordArchivedWidget and CustomSingleRelatedRecordArchivedWidget as custom Visualforce components in the Archive managed package.
Note This content relates to Archive. For Salesforce Archive, see Store Data Externally with Salesforce
Archive.
The steps outlined are necessary only if you're creating a widget for objects that aren't included in the managed package. If this doesn't apply to your configuration, ignore these steps.
To create the Archive Widget:
- To open the dropdown menu, click the Settings icon.
- Select Setup.
- Enter Visualforce Pages in the Quick Find box.
-
Click New.
In the Page Information section, enter a name for the new Visualforce page that references the specific object.Note Use underscores instead of spaces for the Visualforce page name.
-
In the Visual Markup section, insert this code into the
CustomListRelatedRecordArchivedWidgetbody.<apex:page standardController="Account"> <apex:includeLightning /> <div id="lightning" /> <div id="showErrornotSupported"></div> <style> lightning-breadcrumb.slds-breadcrumb__item { text-align: center !important; } .toastModal { 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> -
In the Visual Markup section, insert this code into the
CustomSingleRelatedRecordArchivedWidgetbody.<apex:page standardController="Account"> <apex:includeLightning /> <div id="lightning" /></div> <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:"ContentDocument" }, "lightning", function (cmp) { } ); }); </script> </apex:page> - After making necessary adjustments, click Save.
- Add the Archive Widget to Page Layout in Salesforce Classic
Add a Archive managed package component, also known as a widget, to Lightning experience record pages in Salesforce Classic.
Add the Archive Widget to Page Layout in Salesforce Classic
Add a Archive managed package component, also known as a widget, to Lightning experience record pages in Salesforce Classic.
- In Setup, go to the object's layout.
- Click Edit Layout.
- Create a section in the object layout.
- From the Components menu, select Visualforce Page.
- In Section Properties, select CustomListRelatedRecordArchivedWidget or CustomSingleRelatedRecordArchivedWidget, or both.
- Enter a Section Name for the new section.
- Click 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 500.
- Turn on the Show scrollbars option.
-
Click Save.
The new widgets are now visible on the page layout.