-
Notifications
You must be signed in to change notification settings - Fork 26
MobileCRM.CultureInfo.initialize
rescocrm edited this page Aug 2, 2024
·
10 revisions
[v10.2] Initializes the CultureInfo object.
Method loads the current culture information asynchronously and calls either the errorCallback with error message or the callback with initialized CultureInfo object.
All other functions will return the default or empty string before the initialization finishes.
Argument | Type | Description |
---|---|---|
callback | function(currentCulture) | The callback function that is called asynchronously with initialized CultureInfo object as argument. |
errorCallback | function(errorMsg) | The errorCallback which is to be called in case of error. |
scope | Object | The scope for callbacks. |
This example demonstrates how to initialize CultureInfo object providing information about current culture.
MobileCRM.CultureInfo.initialize(function (currentCulture) {
///<param name='currentCulture' type='MobileCRM.CultureInfo' />
var cultureInfo = "Display name: " +
currentCulture.displayName +
"\n" +
"ISO name: " +
currentCulture.ISOName +
"\n" +
"Native name: " +
currentCulture.nativeName +
"\n\n" +
"Number format: " +
JSON.stringify(currentCulture.numberFormat) +
"\n\n" +
"DateTime format: " +
JSON.stringify(currentCulture.dateTimeFormat) +
"\n" +
"Right to left: " +
currentCulture.isRightToLeft +
"\n";
// for further details about date, time and number format,
// see MobileCRM.DateTimeFormat and MobileCRM.NumberFormat
MobileCRM.bridge.alert(cultureInfo);
}, MobileCRM.bridge.alert, null);