Tag Archives: Context

Microsoft Dynamics CRM 2013 Client-side context

getContext

context = eContext.getContext();

getClient

Returns a value to indicate which client the script is executing in.

context.client.getClient();
Client Value
Browser Web
Outlook Outlook
Mobile Mobile

getClientState

Returns a value to indicate the state of the client.

Use this instead of the deprecated isOutlookOnline method.

context.client.getClientState();
Client Valid Clients
Online Web, Outlook, Mobile
Offline Outlook, Mobile

getClientUrl

Returns the base URL that was used to access the application.

Use this instead of the deprecated getServerUrl method.

context.getClientUrl();
Client Value
Microsoft Dynamics CRM (on-premises) http(s)://server/org
Microsoft Dynamics CRM Online https://org.crm.dynamics.com
Microsoft Dynamics CRM for Outlook with Offline Access when offline http://localhost:2525

getCurrentTheme

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

context.getCurrentTheme();
Value Theme
default Microsoft Dynamics CRM web application
Office12Blue Microsoft Dynamics CRM for Outlook 2007 or 2010 Blue Theme
Office14Silver Microsoft Dynamics CRM for Outlook 2007 or 2010 Silver or Black Theme

getOrgLcid

Returns the LCID value that represents the base language for the organization

context.getOrgLcid();

Vaild locale ID values can be found at Locale ID Chart.

The most needed:

English … 1033
French … 1036
German … 1031

getOrgUniqueName

Returns the unique text value of the organization’s name.

context.getOrgUniqueName();

getQueryStringParameters

Returns a dictionary object of key value pairs that represent the query string arguments that were passed to the page.

context.getQueryStringParameters();

getUserId

Returns the GUID of the SystemUser.Id value for the current user.

context.getUserId();

getUserLcid

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

context.getUserLcid();

Vaild locale ID values can be found at Locale ID Chart.

getUserName

Returns the name of the current user.

context.getUserName();

This method is only available for Updated Entities.

getUserRoles

Returns an array of strings that represent the GUID values of each of the security roles that the user is associated with or any teams that the user is associated with.

context.getUserRoles();

prependOrgName

Prepends the organization name to the specified path.

context.prependOrgName(sPath);

The value returned follows this pattern: “/”+ OrgName + sPath

Leave a Reply

Your email address will not be published. Required fields are marked *


*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>