You are here:
Customize the Asset Viewer in Enterprise Sales Management (Managed Package)
Go through assets in the asset viewer in Enterprise Sales Management. To help your users easily find specific information, customize the asset viewer by extending the b2bAssetViewer components in Lightning web component.
Required Editions
This feature is part of the Communications Cloud managed package.
| Available in: Lightning Experience |
| Available in: Enterprise, Unlimited, and Developer Editions |
| Required User Permissions | |
|---|---|
| To customize the asset viewer: | Communications Cloud Admin |
- From the App Launcher, find and select LWC Designer.
- To create a custom Lightning web component, click +LWC.
- On the Extend tab, enter customB2bAssetViewer as the name of the Lightning web component.
- Select b2bAssetViewer as the Lightning web component to be extended.
- Select Include XML Targets and Omniscript Support.
- Click Create.
- Select customB2bAssetViewer.html as the file.
- Copy the entire HTML code from b2bAssetViewer and paste it in the Editor.
-
In the html file, replace all Lightning web component tags containing “c-” with namespace
of the org.
For example, replace <c-b2b-assets></c-b2b-assets> with <vlocity_cmt-b2b-assets></vlocity_cmt-b2b-assets>
- Save your changes.
- From the App Launcher, find and select Accounts.
- Select any account with assets, and click the Asset tab.
-
Click
, and select Edit Page.
- From the left panel on the Asset tab, drag customB2bAssetViewer to the canvas.
-
Save and your changes, and activate the Lightning web component.
Certain features, such as Asset to Quote, require the configurations available in b2bEnterpriseAssetViewerWrapper.
-
To hide the OOTB b2bAssetViewer and show the customB2bAssetViewer on the user interface
with the configurations from b2bEnterpriseAssetViewerWrapper, add this
code to your custom styling file before you upload this file to your
org.
.b2b-enterprise-assetvieweraura-wrapper { display: none }See Customize the Style Element of your Enterprise Sales Management User Interface.
- Display Additional Fields in Asset Viewer Table
In Enterprise Sales Management, you can display additional fields in the asset viewer table to view additional information by using the b2bExpress/assetConfigData integration procedure. - Add Custom Buttons to the Asset Viewer
In Enterprise Sales Management, you can add custom buttons preceding the asset viewer table to use custom actions by extending the b2bAssetViewer and b2b2Assets Lightning web component. - Create Dynamic Search Feature in Asset Viewer
In asset viewer, use the dynamic search feature to define searchable fields in the metadata and add them to the view as search criteria dynamically. Extend the b2bAssetViewer and b2b2Assets Lightning web component to add a dropdown next to the search input box.
Display Additional Fields in Asset Viewer Table
In Enterprise Sales Management, you can display additional fields in the asset viewer table to view additional information by using the b2bExpress/assetConfigData integration procedure.
- From the App Launcher, find and select Omnistudio Integration Procedures.
- Click b2bExpress/assetConfigData from the list.
- Under Structure, select Procedure Configuration, and then click Create Version.
- Select responseData, and then click Edit as JSON.
-
Add the additional fields required. You can use this sample JSON to add an Action
field.
{ "dataType": "Text", "label": "Action", "topic": [ "All" ], "valueMap": "vlocity_cmt__Action__c" } - Activate the integration procedure.
The additional field are displayed as columns in the asset viewer.
Add Custom Buttons to the Asset Viewer
In Enterprise Sales Management, you can add custom buttons preceding the asset viewer table to use custom actions by extending the b2bAssetViewer and b2b2Assets Lightning web component.
- Create a custom Lightning web component.
- To create another custom Lightning web component, click +LWC.
- On the Extend tab, enter customB2bAssets as the name of the Lightning web component.
- Select b2bAssets as the Lightning web component.
- Select Include HTML, Include XML Targets, and Omniscript Support.
- Click Create.
- Select customB2bAssets.html as the file.
- In the Editor, enter the entire HTML code from b2bAssets.
-
Replace all Lightning web component tags in the html file containing “c-” with namespace of
the org.
For example,
<c-b2b-assets></c-b2b-assets>with<vlocity_cmt-b2b-assets></vlocity_cmt-b2b-assets>. - In the HTML file, search for lightning-button-group tag and add buttons within this tag.
- Save your changes.
-
Open customB2bAssetViewer.html file and replace b2bAssets Lightning web component tag with
customB2bAssets.
For example,
<c-b2b-assets></c-b2b-assets>with<c-custom-b2b-assets></c-custom-b2b-assets>. - Save your changes.
Create Dynamic Search Feature in Asset Viewer
In asset viewer, use the dynamic search feature to define searchable fields in the metadata and add them to the view as search criteria dynamically. Extend the b2bAssetViewer and b2b2Assets Lightning web component to add a dropdown next to the search input box.
- Create a custom Lightning web component.
- To create another custom Lightning web component, click +LWC.
- On the Extend tab, enter customB2bAssets as the name of the Lightning web component..
- Select b2bAssets as the Lightning web component.
- Select Include HTML, Include XML Targets, and Omniscript Support.
- Click Create.
- Select customB2bAssets.html as the file.
- In the Editor, enter the entire HTML code from b2bAssets.
-
Replace all Lightning web component tags in the html file containing “c-” with namespace of
the org.
For example,
<c-b2b-assets></c-b2b-assets>with<vlocity_cmt-b2b-assets></vlocity_cmt-b2b-assets>. - Select customB2bAssets.js as the file.
-
In the Editor, enter this code under the connectedCallback.
this.dataColumns.forEach(item => { if (item.searchable && item.columnDataType === "Text") { this.searchByCustomOptions.push({ label: item.label, value: item.valueMap }); } })In the b2bAssets.js file, column details are stored in a dataColumns variable. This variable is used to assign column details to another variable, which serves as the source for the dynamic search feature dropdown. Here, searchByCustomOptions is a list and acts as a source for a dynamic search feature dropdown.
-
Select customB2bAssets.html as the file, and enter required HTML
code to add a dropdown.

- Save your changes.

