getGlobalContext (Client API reference)

Applies to Dynamics 365 for Customer Engagement apps version 9.x

Gets the global context.

The method provides access to the global context without going through the form context. It contains an equivalent of all the methods available for the Xrm.Page.context object (now deprecated) to retrieve information specific to the client, organization or user.

Important

To access the global context information in a standalone HTML Web resource, you should include a reference to ClientGlobalContext.js.aspx in the web resource, and then use the GetGlobalContext function. More information: GetGlobalContext function and ClientGlobalContext.js.aspx

Properties of Global Context (getGlobalContext)

Use the following properties of global context to return information about the client, organization settings, or user settings:

Property Description
client Returns information about the client.
organizationSettings Returns information about the current organization settings.
userSettings Returns information about the current user settings.

Methods of Global Context (getGlobalContext)

Method Description
getAdvancedConfigSetting Returns information about the advanced configuration settings for the organization.
getClientUrl Returns the base URL that was used to access the application.
getCurrentAppName Returns the name of the current business app in Customer Engagement.
getCurrentAppProperties Returns the properties of the current business app in Customer Engagement.
getCurrentAppUrl Returns the URL of the current business app in Customer Engagement.
getVersion Returns the version number of the Dynamics 365 for Customer Engagement apps instance.
isOnPremises Returns a boolean value indicating if the Customer Engagement instance is hosted on-premises or online.
prependOrgName Prefixes the current organization's unique name to a string, typically a URL path.