Below is the New Syntax available to get Current Organization Settings in Dynamics 365 V9.X,
var organizationSettings = Xrm.Utility.getGlobalContext().organizationSettings;
The organizationSettings object provides following properti
es.Syntax | Type | Description |
organizationSettings.attributes | Object | An object with attributes and their values. |
organizationSettings.baseCurrencyId | String | ID of the base currency. |
organizationSettings.defaultCountryCode | String | Default country/region code for phone numbers. |
organizationSettings.isAutoSaveEnabled | Boolean | true if enabled; false otherwise. |
organizationSettings.languageId | Number | Preferred Language ID. For example: 1033 for English |
organizationSettings.organizationId | String | Id of the current organization. |
organizationSettings.uniqueName | String | Unique name of the current organization. |
organizationSettings.useSkypeProtocol | Boolean | true if Skype protocol is used; false otherwise. |
Example: Below function configured in Account Page Load.
function GetOrganizationDetails() { var outputText = "Organization Details\n--------------------------------------------\n"; var organizationSettings = Xrm.Utility.getGlobalContext().organizationSettings; outputText += "Unique Name : " + organizationSettings.uniqueName +"\n"; outputText += "Id : " + organizationSettings.organizationId + "\n"; outputText += "Language Id : " + organizationSettings.languageId + "\n"; outputText += "Base Currency Id : " + organizationSettings.baseCurrencyId + "\n"; outputText += "Default Country Code : " + organizationSettings.defaultCountryCode + "\n"; outputText += "Is Auto Save Enabled : " + organizationSettings.isAutoSaveEnabled + "\n"; outputText += "Use Skype Protocol : " + organizationSettings.useSkypeProtocol + "\n"; outputText += "Attributes : " + organizationSettings.attributes; Xrm.Utility.alertDialog(outputText, null); }
Output:


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