pageNavigated

pageNavigated

Mandatory: No

Description: The pageNavigated feature allows the CRM Connector application to perform background actions based on the current page.

When the client application detects a page change in the CRM, it sends a pageNavigated message with the page data to the CRM Connector.

The CRM Connector then sends back a pageNavigatedReceived confirmation message, allowing the application flow to continue without requiring any additional changes or adjustments in the client application.

This feature is optional.

Example

// For publishMessage method explanation see Getting started.
const sendCRMData = () => {
  // Your own implementation to obtain the data based on the CRM.
  publishMessage(clientIframe, CRM_CONNECT_ORIGIN, 'ClientAppMessage', 'pageNavigated', <page-data>);
}
  • clientIframe represents the iFrame where the application is embedded. usually we can set an id and access in this way
clientIframe = document.getElementById('crmConnectIframeId');
  • CRM_CONNECT_ORIGIN represents the URL or origin of the CRM Connector application. For a more explicit documentation see Getting started.

Note: For each message sent by CRM Connector that needs to be intercepted by the client application, ensure there is a mechanism in place to verify and process the received messages.

  • page-data represents the information about the current page that was loaded successfully

Message formats

CRM Connector

{ "type": "CRMConnectMessage", "action": "pageNavigatedReceived" }

Client Application

{ "type": "ClientAppMessage", "action": "pageNavigated", "data": "<page_data>" }