Viewing MyInsights Content in Lightning

  • Online (Lightning)

To create dynamic page layouts, admins can embed MyInsights content in Lightning pages, including territory-level content and content visible only for specific records. This allows Lightning users to view and interact with MyInsights content online alongside standard Salesforce Lightning components.

For example, Sarah Jones uses Veeva CRM on a desktop computer. She has two territory-level MyInsights visualizations, one for pre-call planning and one for administrative tasks. To allow Sarah to view MyInsights visualizations online, an admin adds both visualizations to her home page in Lightning. Sarah can start her day by consulting both visualizations online and planning her daily activities.

Considerations

  • Developers can create MyInsights content for Lightning with integrated Nitro data using the queryVDSRecord method
  • Developers must include the <!DOCTYPE html> header in the index.html file
  • If multiple MyInsights Lightning web components display on the same page and are not using the updated JavaScript library, query performance may be degraded and using the getDataForCurrentObject JavaScript method to retrieve data about the HTML_Report_vod object from CRM may return incorrect data. Veeva recommends ensuring all content uses the updated MyInsights JavaScript library.
  • The Territory Insights visualization is supported in Lightning for territories with up to 4500 accounts
  • The Inventory Monitoring Dashboard is not supported in Lightning

Configuring MyInsights Content for Lightning

To enable MyInsights content for Lightning:

  1. Ensure MyInsights and Viewing MyInsights Content Online are configured.
  2. Grant end users access to the MyInsightsService Apex class.
  3. Navigate to Setup > Security > CSP Trusted Sites.
  4. Add the org’s Salesforce domain as a trusted site. The Salesforce domain can be found in the My Domain settings.
  5. Navigate to Setup > Security > CORS.
  6. Add the org’s Lightning domain to the CORS Allowed Origins List. The Lightning domain can be copied from the browser’s address bar when viewing Veeva CRM in Lightning.
  7. Navigate to the appropriate HTML_Report_vod record.
  8. Select Lightning for the Platform_vod field.
  9. Ensure HTML_Report_vod and Attachment VMOCs with platform-specific WHERE clauses for mobile platforms are enabled. For example, the HTML_Report_vod VMOCs for the iPad and Windows platforms include the following criterion in the WHERE clause:
    • Platform_vod__c includes ('Mobile_Device_vod')
  10. Deactivate HTML_Report_vod and Attachment VMOCs without platform-specific WHERE clauses to prevent Lightning only content from syncing to mobile devices.

Adding MyInsights Content to Lightning Pages

To view MyInsights content in Lightning, admins must add the MyInsights Lightning web component (LWC) to the appropriate Lightning page via the Lightning App Builder. Multiple MyInsights LWCs can be added to a page.

Admins can also add MyInsights LWC as tabs in a Tabs LWC. However, if a user does not have visibility to the MyInsights content in a tab, an empty tab displays. To avoid empty tabs, Veeva recommends adding MyInsights content with limited visibility as independent MyInsights LWCs on a Lightning page.

The following Lightning page types support the MyInsights LWC and can display different MyInsights content depending on the HTML_Report_vod record types:

Lightning Page

Available HTML_Report_vod Record Types

Home Page

  • Territory_Insights_vod
  • Territory_Insights_Default_vod

App Page

  • Territory_Insights_vod
  • Territory_Insights_Default_vod

Account Record Page

  • Account_Profile_Override_vod
  • KOL_Profile_vod
  • Account_Reports_vod
  • Territory_Insights_vod
  • Territory_Insights_Default_vod

Account Plan Record Page

  • Account_Plan_vod
  • Account_Profile_Override_vod
  • KOL_Profile_vod
  • Account_Reports_vod
  • Territory_Insights_vod
  • Territory_Insights_Default_vod

Inventory Monitoring Record Page

  • Inventory_Monitoring_vod
  • Account_Profile_Override_vod
  • KOL_Profile_vod
  • Account_Reports_vod
  • Territory_Insights_vod
  • Territory_Insights_Default_vod

Order Record Page

  • Orders_vod
  • Account_Profile_Override_vod
  • KOL_Profile_vod
  • Account_Reports_vod
  • Territory_Insights_vod
  • Territory_Insights_Default_vod

All other record pages

  • Territory_Insights_vod
  • Territory_Insights_Default_vod

After adding the MyInsights LWC to the page layout, admins can select the content to display from a dropdown menu of the available HTML_Report_vod records. Only HTML_Report_vod records with the appropriate record types display.

Optionally, admins can also define the maximum height of the component in pixels. If defined, the content never exceeds the maximum height, even when resized.

When using out-of-the-box visualizations not supported on the iPhone platform, ensure the LWC has sufficient horizontal space to allow the content to display fully.

Since the LWC is responsive, if users resize their browser window, the content also resizes appropriately. To allow MyInsights content to dynamically resize, developers must use the updated MyInsights JavaScript library and must not use the following CSS styles on the html tag:

  • height: 100%
  • max-height: 100%