Loading
The Trailblazer Community is now read-only Read More
Media Cloud
Set Up Pagination for Advertising Sales Management

Set Up Pagination for Advertising Sales Management

Set up the pagination feature for improved response times from Advertising Sales Management.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

Note
Note If your company is currently using or upgrading from a version of Media Cloud prior to Spring '24, see the Considerations for Previous Media Cloud Versions section of this page.

When you enable the pagination feature, each product is displayed on a separate row, and can contain multiple line items, as in the case of a bundle. For optimal performance and scalability, Salesforce recommends that you retain the default setting of displaying 10 line items per page.

When you add or clone line items that are not on the first page, then the recently added or cloned line items are moved to the first page. Line items related to a single channel, station, or publication, might be split across pages if a particular page has reached its line item limit.

To set up pagination, follow these steps:

Enable the isGridPagination Custom Setting

Enable the isGridPaginationEnabled custom setting to scale Advertising Sales Management to support up to 100 line items in the media plan.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

  1. In your Advertising Sales Management org, go to Settings and then click Setup.
  2. In Quick Find, search for and select Custom Settings.
  3. Click Manage associated with Media Configuration.
  4. From the list, click Edit associated with the isGridPaginationEnabled custom setting.
  5. Select the Setup Value option, and then click Save.

Enable the lazyLoadAttributes Custom Setting

When you enable the isGridPaginationEnabled custom setting, you can also choose to enable the lazyLoadAttributes custom setting.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

The lazyLoadAttributes custom setting enables Advertising Sales Management to postpone attribute retrieval until you access the attribute modal for a specific line item, resulting in faster response times from Advertising Sales Management. By default, the lazyLoadAttributes custom setting is disabled.

  1. In your Advertising Sales Management org, go to Settings and then click Setup.
  2. In Quick Find, search for and select Custom Settings.
  3. Click Manage associated with Media Configuration.
  4. From the list, click Edit associated with the lazyLoadAttribute custom setting.
  5. Select the Setup Value option, and then click Save.

Update Page Sizes

Update the number of rows displayed on a page. By default, 10 rows are displayed on a page.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

You can update page sizes to show a specific number of rows per page. A product bundle is considered to be a single row, number of placements irrespective. For example, if you have multiple bundles of four placements each, and they appear on a single page, then the number of placements displayed on the page would be 40, but the number of rows would be 10. Ensure that you take the number of placements in your media bundle into consideration before changing your page size. Salesforce recommends that you display a maximum of 20 placements per page.

  1. From App Launcher, search and select OmniStudio Integration Procedures.
  2. Open the latest version of the vplAdsFetchMediaCampaigns Integration Procedure.
  3. In the PaginationDefaults step, update the value of defaultPageSize.
    If you choose to specify a number of rows per page that isn't available in the defaultPageSize field, then ensure that you first add the value to the pageSizeOptions list before updating defaultPageSize. To do so, complete these steps:
    1. From App Launcher, search for and click OmniStudio Integration Procedures.
    2. Click the latest version of vplAdsFetchMediaCampaigns.
    3. Select Pagination Defaults, and click Edit as JSON.
    4. Update pageSizeOptions with the required values.
  4. From App Launcher, search and select OmniStudio FlexCards.
  5. Open the latest version of the sfiAdsDigitalGrid flexcard.
  6. From the Pagination Grid state, click sfiAdsDigitalPaginationHandler.
  7. On the Properties tab, add this attribute:
    • Name: defaultPageSize
    • Value: Enter a value for the number of rows to display.
  8. Activate the flexcard.

Considerations for Older Versions of Media Cloud

With the pagination feature, there are some changes to the existing core components in Advertising Sales Management. Review these changes against the configuration in your Salesforce org.

Managed Package Icon This is an Advertising Sales Management on Managed Package feature. For Advertising Sales Management on Salesforce Platform, see Advertising Sales Management on Salesforce Platform.

Core Component Changes

  • The vplAdsFetchMediaPlanPlacement Omnistudio Data Mapper is no longer in use. In releases prior to Spring '24, the vplAdsFetchMediaPlanPlacement Data Mapper is invoked to populate the data in the media placement grid. However, in the Spring '24 release and later, an Apex remote method is called, which executes the Data Mapper by default, and additional parameters (such as page size, and offset) are passed. The response returned is the same as that of the Data Mapper.

  • The vplAds_GetCartDetails Integration Procedure is no longer used to update Footer information for total placements, price, and attributes associated with the line items in the media plan. In Spring '24 and later, sfiAds_fetchGridFooterInformation is used to update the total placements in the cart and the total price, and also to validate the Next button in the footer. The pagination service invokes sfiAds_GetMediaPlanPlacements to fetch the attributes associated with the products in the media plan. If lazyLoadAttributes is set, then it gets populated when you open the attribute modal.

  • dataArray is not used in OmniScripts. In earlier releases, all details of line items in a media plan were saved as part of dataArray in the OmniScript. With Spring '24, dataArray is no longer used. All line item details are available as PlacementDetails in the OmniScript data for each media type.

Pubsub Events

With Spring '24, Advertising Sales Management provides pubsub events to support customizations. These pubsub events can be used according to your business needs.

  • Invoke pagination service. To invoke the pagination service from your custom Lightning Web Component, fire the sfi-ads-invoke-pagination-for-[X] pubsub, where [X] is the media type.

    pubsub.fire("sfi-ads-invoke-pagination-for-<your-mediatype>", "result", {
        selectedPage: 1//By default it is 1 or you can even pass the current selected page,
        pageSize: this.defaultPageSize,
        resetCache: true
    });
  • Update the Grid Data. The PlacementDetails node in the OmniScript data updates the data on the media planning grid, by taking a list of all the line items you want to display on that page. Fire the sfiAds-update-omniscript-data-for-<X>, where <X> is the media type.

    pubsub.fire("sfiAds-update-omniscript-data-for-<your-mediatype>", "result", {
        PlacementDetails: placementDetails// List of all the lineitems details to be displayed
    })
  • Validate the Next button. To validate the Next button in the footer for your custom code, fire the validate_next_button_for_pagination pubsub.

    let osData = JSON.parse(JSON.stringify(getOmniJsonData(this, this.osname)));
    let paginationObj = `paginatedDetails${this.mediaType}`;
    this.paginatedDetails = osData[paginationObj];
    pubsub.fire("validate_next_button_for_pagination", "result", {
        [paginationObj]: this.paginatedDetails
    });
 
Loading
Salesforce Help | Article