Edit

Client API Xrm object for model-driven apps

You can use the client API Xrm object in your code without the execution context. Use its namespaces to navigate forms, manage records with the Web API, use device capabilities, and retrieve global context in model-driven apps.

Xrm object model

The following illustration displays the Xrm object model:

Screenshot of the client API Xrm object model showing its namespaces.

Here's the information about each of the namespaces in the Xrm object:

Namespace Description
Xrm.App Provides app-related methods.
Xrm.Copilot Provides methods for interacting with Microsoft Copilot in model-driven Power Apps, including preview APIs for executing registered Microsoft Copilot Studio topics.
Xrm.Device Provides methods to use native device capabilities.
Xrm.Encoding Provides methods to encode strings.
Xrm.Navigation Provides methods for navigating forms and items in model-driven apps.
Xrm.Panel Provides a method to display a web page in the side pane of model-driven apps form.
Xrm.Utility Provides a container for useful methods.
Xrm.WebApi Provides methods to use Web API to create and manage records and execute Web API actions and functions.

Xrm.WebApi.offline: Provides methods to create and manage records in the model-driven apps in mobile clients while working in offline mode.

Xrm.WebApi.online: Provides methods to use Web API to create and manage records and execute Web API actions and functions when connected to the server.

Client API global context

Use the Xrm.Utility.getGlobalContext method in forms to retrieve information specific to an organization, a user, or the client where script runs without going through the form execution context. Using the getGlobalContext method is a change from previous versions where you had to use the form context to retrieve global context by using Xrm.Page.context.

Note

Xrm.Page.context is deprecated in the current release, and you should now use the new Xrm.Utility.getGlobalContext method to get global context in your code targeting version 9.0 or later.

To access the global context information in a standalone HTML web resource, include a reference to ClientGlobalContext.js.aspx in the web resource, and then use the GetGlobalContext function. For more information, see GetGlobalContext function and ClientGlobalContext.js.aspx.

Understand the Client API object model
Deprecated client APIs