Xrm.Page.context

[Applies to: Microsoft Dynamics CRM 2011]

Xrm.Page.context provides access to the context object. The context object provides methods to retrieve information specific to an organization, a user, or parameters that were passed to the form in a query string.

Xrm.Page.context

Xrm.Page.context provides access to the following functions:

  • getAuthenticationHeader: Deprecated. Returns the encoded SOAP header necessary to use Microsoft Dynamics CRM web service calls using JScript.

  • getClientUrl: Returns the base URL used to access the application.

  • getCurrentTheme Returns a string representing the current Microsoft Office Outlook theme chosen by the user.

  • getOrgLcid: Returns the LCID value that represents the Microsoft Dynamics CRM Language Pack that is the base language for the organization.

  • getOrgUniqueName: Returns the unique text value of the organizations name.

  • getQueryStringParameters: Returns an array of key value pairs representing the query string arguments that were passed to the page.

  • getServerUrl: Deprecated. Use getClientUrl instead. Returns the base server URL. When a user is working offline with Microsoft Dynamics CRM for Microsoft Office Outlook, the URL is to the local Microsoft Dynamics CRM Web services.

  • getUserId: Returns the GUID value of the SystemUser.id value for the current user.

  • getUserLcid: Returns the LCID value that represents the Microsoft Dynamics CRM Language Pack that is the user selected as their preferred language.

  • getUserRoles: Returns an array of strings representing the GUID values of each of the security roles that the user is associated with.

  • isOutlookClient: Returns a Boolean value indicating if the user is using Microsoft Dynamics CRM for Microsoft Office Outlook.

  • isOutlookOnline: Returns a Boolean value indicating whether the user is connected to the Microsoft Dynamics CRM server while using Microsoft Dynamics CRM for Microsoft Office Outlook with Offline Access. When this function returns false, the user is not connected to the server. The user is interacting with an instance of Microsoft Dynamics CRM running on the local computer.

  • prependOrgName: Prepends the organization name to the specified path.

See Also

Reference

Xrm.Page Reference
Client-Side Context Reference
GetGlobalContext Function

Concepts

Form Scripting Quick Reference
Write Code for Microsoft Dynamics CRM Forms
Use the Xrm.Page Object Model

Microsoft Dynamics CRM 2011
Send comments about this topic to Microsoft.
© 2013 Microsoft Corporation. All rights reserved.