Skip to content

Arun Potti's MS CRM blog

Microsoft Dynamics CRM

  • Home
  • About Me
HomePosts tagged 'user settings in crm'

user settings in crm

How to get the Current User Settings using JavaScript in Dynamics 365 V9.X?

December 31, 2017 Arun Potti CRM, Microsoft Dynamics 365 Javascript user settings in dynamics crm 365, user settings in crm

Below is the New Syntax available to get CRM LoggedIn User Settings in Dynamics 365 V9.X,

var userSettings = Xrm.Utility.getGlobalContext().userSettings;

The userSettings object provides following properties,

Syntax Type Description
userSettings.dateFormattingInfo() Object Returns the date formatting information object for the current user.

An object with informatiuon about date formatting such as FirstDayOfWeek, LongDatePattern, MonthDayPattern, TimeSeparator, and so on.

userSettings.defaultDashboardId String Returns the ID of the default dashboard for the current user.
userSettings.isGuidedHelpEnabled Boolean Indicates whether guided help is enabled for the current user.

returns true if enabled; false otherwise.

userSettings.isHighContrastEnabled Boolean Indicates whether high contrast is enabled for the current user.

returns true if enabled; false otherwise.

userSettings.isRTL Boolean Indicates whether the language for the current user is a right-to-left (RTL) language.

returns true if it is RTL; false otherwise.

userSettings.languageId Number Returns the language ID for the current user.
userSettings.securityRolePrivileges Array Returns an array of strings that represent the GUID values of each of the security role privilege that the user is associated with or any teams that the user is associated with.

GUID values of each of the security role privilege.

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

GUID values of each of the security role. For example:

[“0d3dd20a-17a6-e711-a94e-000d3a1a7a9b”, “ff42d20a-17a6-e711-a94e-000d3a1a7a9b”].

userSettings.transactionCurrencyId String Returns the transaction currency ID for the current user.
userSettings.userId String Returns the GUID of the SystemUser.Id value for the current user.

The ID of the user. For example:

“{75B5BA27-FD41-4D45-8E3A-C8446C95F0CC}”

userSettings.userName  String  Name of the current user.
 userSettings.getTimeZoneOffsetMinutes()  Number  Returns the difference in minutes between the local time and Coordinated Universal Time (UTC).

Time zone offset in minutes.

Example: Below function configured on Account Page Load.

function GetUserSettingsDetails() {
 var outputText = "User Settings Details\n--------------------------------------------\n";
 var userSettings = Xrm.Utility.getGlobalContext().userSettings;

 outputText += "Date Formatting Info : " + userSettings.dateFormattingInfo() + "\n";
 outputText += "Is Guided Help Enabled: " + userSettings.isGuidedHelpEnabled + "\n";
 outputText += "Is High Contrast Enabled : " + userSettings.isHighContrastEnabled + "\n";
 outputText += "RTL (Right To Left) : " + userSettings.isRTL + "\n";
 outputText += "Language Id : " + userSettings.languageId + "\n";
 outputText += "Security Roles : " + userSettings.securityRoles + "\n";
 outputText += "Transaction Currency Id : " + userSettings.transactionCurrencyId + "\n";
 outputText += "User Guid : " + userSettings.userId + "\n";
 outputText += "User Name : " + userSettings.userName + "\n";
 outputText += "Time Zone Offset Minutes : " + userSettings.getTimeZoneOffsetMinutes() + "\n";

Xrm.Utility.alertDialog(outputText, null);
}

Output:

User Settings Popup
User Settings Alert
User Settings
dateFormattingInfo Debug – Add Watch View

Hope you learned a new thing today :):):)

Share this:

  • Tweet

Like this:

Like Loading...
Leave a comment

Blog Stats

  • 733,646 hits

Recent Certifications

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 1,468 other followers

Follow me on

  • LinkedIn

Recent Posts

  • What is Microsoft Dataverse?
  • How to create Rich Text Editor in Dynamics 365 CE?
  • How to create Microsoft Dynamics 365 Trial instance?
  • Power Automate UI Flows are available in CoE Starter Kit
  • Where does our Dynamics 365 online data stored?

Recent Comments

Shayur Maharaj on Power Automate UI Flows are av…
pavan on What is Microsoft Dataver…
anandsingh28 on How to create Microsoft Dynami…
ichi on Step by Step to connect Dynami…
How to create Rich T… on How to create Microsoft Dynami…

Top Posts & Pages

  • How to create Microsoft Dynamics 365 Trial instance?
  • Get Lookup id / Text / EntityName in CRM using JavaScript
  • Step by Step to connect Dynamics 365 CRM Online V9.X using C# Console Application
  • How to retrieve a record in Dynamics 365 Online V 9.X using JavaScript WebAPI?
  • Dynamics 365 CRM SDK Download link
  • REST - Retrieve Example
  • Import Notes with Attachments using Data Import in CRM
  • How to get the Logged In User Security Role Names using JavaScript in Dynamics 365 V9.X?
  • Retrieve records using Fetch XML & Java Script in CRM 2011/13
  • How to retrieve multiple records in Dynamics 365 Online V 9.X using JavaScript WebAPI?

Archives

  • November 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • December 2017
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • November 2016
  • October 2016
  • July 2016
  • June 2016
  • May 2016
  • April 2016
  • March 2016
  • February 2016
  • December 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • June 2014
  • May 2014
  • April 2014
  • March 2014

Categories

  • .Net
  • Actions
  • AI
  • Azure
  • Browser Extensions
  • Build Tools
  • Certifications
  • CRM
  • crm 2011
  • CRM 2015
  • CRM 2016
  • Custom Controls
  • Customer Voice
  • Developer Tool Kit
  • Dynamics 365 Portals
  • Early Bound
  • Fetch XML
  • FieldOne Sky
  • HTML
  • Javascript
  • Microsoft Dynamics 365
  • Microsoft Dynamics CRM 2016
  • Microsoft Dynamics Marketing
  • Microsoft Flow
  • microsoft social engagement
  • MS CRM 2013
  • ms crm 2015
  • Others
  • Phones
  • Phones App
  • Plugins
  • Power Apps
  • power automate
  • PowerApps
  • Real Time Workflow
  • Reports
  • SdK
  • SharePoint
  • SQL
  • sql server
  • Tools
  • UCI
  • unified service desk
  • USD
  • Web API

Meta

  • Register
  • Log in
  • Entries feed
  • Comments feed
  • WordPress.com
Blog at WordPress.com.
Cancel

 
Loading Comments...
Comment
    ×
    %d bloggers like this: