Resco Mobile CRM - Javascript Bridge Reference

Official JSBridge GitHub Page

MobileCRM Namespace

The MobileCRM namespace encapsulates all the functionality of the Resco MobileCRM Javascript Bridge (later JSBridge).

Namespaces

NamespaceDescription
FetchXmlContains a set of objects implementing the FetchXML request methods
UI

Contains a set of objects implementing the Javascript equivalent of the MobileCRM application UI components.

These objects are not available under Essential license.

UI.DetailViewItemsContains a set of objects representing particular detail view items.
ServicesContains non-UI classes for accessing documents...
Services.WorkflowContains objects accessing the Dynamics 365 workflow.

Properties

PropertyDescription
bridgeSingleton instance of MobileCRM.Bridge providing the management of the Javascript / native code cross-calls.

Objects

ObjectDescription
AboutInfo[v8.2] Represents the branding information.
ActivityPartyPerson or group associated with an activity. An activity can have multiple activity parties.
ApplicationEncapsulates the application-related functionality.
BridgeProvides the management of the Javascript/native code cross-calls. Its only instance MobileCRM.bridge is created immediately after the "JSBridge.js" script is loaded.
ConfigurationProvides an access to the application configuration.
CultureInfo[v10.2] Provides information about current device culture. The information includes the names for the culture, the writing system, the calendar used, and formatting for dates.
DateTimeFormat[v10.2] Provides culture-specific information about the format of date and time values.
DynamicEntityRepresents a CRM entity, with only a subset of properties loaded.
GlobalConstantsProvides access to the global constants.
LocalizationA static object with functions allowing to access the localized texts.
ManyToManyReferenceA static object with functions managing many to many relations.
MetaEntityRepresents an entity metadata.
MetaPropertyRepresents a property (CRM field) metadata.
MetadataA static object with functions for accessing the entity metadata store.
MobileReportProvides a functionality of mobile reporting.
NumberFormat[v10.2] Provides culture-specific information for formatting and parsing numeric values.
OAuthSettings[v12.4] Represents the settings what are used to authenticate using OAuth server account.
ObservableObjectRepresents a generic object which is monitoring the changes of its properties.
PlatformRepresents object for querying platform specific information and executing platform integrated actions.
QuestionnaireProvides a functionality for questionnaires.
ReferenceRepresents an entity reference which provides the minimum information about an entity.
RelationshipRepresents a relationship between two entities.
_DeviceInfoRepresents the device information.
_SettingsInternal object representing the application settings.

MobileCRM.AboutInfo Object

[v8.2] Represents the branding information.

Properties

PropertyTypeDescription
manufacturerStringGets the manufacturer text.
productTitleStringGets the product title text.
productTitleAndVersionString[v9.0] Gets the string with product title and version.
productSubTitleStringGets the product subtitle text.
poweredByStringGets the powered by text.
iconStringGets the icon name.
websiteStringGets the website url.
supportEmailStringGets the support email.

Functions

FunctionDescription
requestObject[v8.2] Asynchronously gets the AboutInfo object with branding information.

MobileCRM.AboutInfo.requestObject Function

[v8.2] Asynchronously gets the AboutInfo object with branding information.

Arguments

ArgumentTypeDescription
callbackfunction(Object)The callback function that is called asynchronously with the about info object.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.

MobileCRM.ActivityParty Object

Person or group associated with an activity. An activity can have multiple activity parties.

Properties

PropertyTypeDescription
entityNameStringThe entity name of the party (account, contact, lead, systemuser, etc.)
idStringGUID of the existing entity or null for new one or direct party.
primaryNameStringThe human readable name of the reference, e.g. "Alexandro".
isDirectPartyBooleanGets or sets whether the party is direct (email) or a pointer to an CRM record.
addressUsedStringGets or sets the actual address used.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.ActivityParty object.

MobileCRM.ActivityParty.constructor Method

Constructs an instance of MobileCRM.ActivityParty object.

Arguments

ArgumentTypeDescription
entityNameStringThe logical entity name of the party (account, contact, lead, systemuser, etc.)
idStringGUID of the existing entity or null for new one or direct party.
primaryNameStringThe human readable name of the reference, e.g "Alexandro".
isDirectPartyBooleanGets or sets whether the party is direct (email) or a pointer to an CRM record.
addressUsedStringGets or sets the actual address used.

MobileCRM.Application Object

Encapsulates the application-related functionality.

Functions

FunctionDescription
checkUserRolesChecks whether the current user is member of the passed roles. Role can be either the Guid (aeb33d0f-89b4-e111-9c9a-00155d0b710a) or the role Name.
createDirectoryAsynchronously creates the directory in the application local data.
createDirectoryAsyncAsynchronously creates the directory in the application local data.
deleteDirectoryAsynchronously deletes the empty directory from the application local data.
deleteDirectoryAsyncAsynchronously deletes the empty directory from the application local data.
deleteFileAsynchronously deletes the file from the application local data.
deleteFileAsyncAsynchronously deletes the file from the application local data.
directoryExistsChecks whether the directory with given path exists in the application local data.
directoryExistsAsyncChecks whether the directory with given path exists in the application local data.
fileExistsChecks whether the file with given path exists in application local data.
fileExistsAsyncChecks whether the file with given path exists in application local data.
getAccessToken[v12.3]Asynchronously gets the access token for the specified resource URL (limited to Microsoft environment without MSAL).
getAppColorGets the customized color by its name.
getAppImageGets the colorized application image. It is taken either from customization package or from application bundle.
getDirectoriesAsynchronously gets the list of directories from the application local data.
getDirectoriesAsyncAsynchronously gets the list of directories from the application local data.
getFilesAsynchronously gets the list of files from the application local data.
getFilesAsyncAsynchronously gets the list of files from the application local data.
getLastSignificantTimeChange[v13.3.1] Gets the last detected time change.
moveFileAsynchronously moves the application local file to another location.
moveFileAsyncAsynchronously moves the application local file to another location.
onSyncFinished[v8.1] Binds the new handler to the synchronization finish event.
readFileReads the file from the application local data and asynchronously gets its content.
readFileAsBase64Reads the file from the application local data and asynchronously gets its base64-encoded content.
readFileAsync[v15.3] Reads the file from the application local data and asynchronously gets its content.
setAppColors[v11.2] Sets the application colors.
showAppLoginCauses that the password is forgotten and user is required to type it again to make the app running.
showSetupCloses all forms and shows the setup screen.
startSmartSync
synchronizeStarts background/foreground sync if not synchronized or the last sync was before desired limit.
synchronizeOnForeground[v8.1] Starts the synchronization on foreground (closes all form if possible and showing the standard progress).
writeFileAsynchronously writes the text into the file from the application local data.
writeFileAsync[v15.3] Asynchronously writes data into the file from the application local data.
writeFileFromBase64Asynchronously writes the base64-encoded data into the application local storage file.
writeFileWithEncoding[v9.0.2] Asynchronously writes the text into the file from the application local data.

MobileCRM.Application.checkUserRoles Function

Checks whether the current user is member of the passed roles. Role can be either the Guid (aeb33d0f-89b4-e111-9c9a-00155d0b710a) or the role Name.

Arguments

ArgumentTypeDescription
rolesArray(String)Defines the roles to check.
successfunction(result)A callback function for successful asynchronous result. The result will carry a number with the count of matching roles.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.createDirectory Function

Asynchronously creates the directory in the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory in the application local data.
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.createDirectoryAsync Function

Asynchronously creates the directory in the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory in the application local data.

MobileCRM.Application.deleteDirectory Function

Asynchronously deletes the empty directory from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory in the application local data.
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.deleteDirectoryAsync Function

Asynchronously deletes the empty directory from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory in the application local data.

MobileCRM.Application.deleteFile Function

Asynchronously deletes the file from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.deleteFileAsync Function

Asynchronously deletes the file from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.

MobileCRM.Application.directoryExists Function

Checks whether the directory with given path exists in the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory located in the application local data.
successfunction(result)A callback function for successful asynchronous result. The result will carry a Boolean object determining whether the directory exists or not.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.directoryExistsAsync Function

Checks whether the directory with given path exists in the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the directory located in the application local data.

MobileCRM.Application.fileExists Function

Checks whether the file with given path exists in application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file located in the application local data.
successfunction(result)A callback function for successful asynchronous result. The result will carry a Boolean object determining whether the file exists or not.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.fileExistsAsync Function

Checks whether the file with given path exists in application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file located in the application local data.

MobileCRM.Application.getAccessToken Function

[v12.3]Asynchronously gets the access token for the specified resource URL (limited to Microsoft environment without MSAL).

Arguments

ArgumentTypeDescription
resourceUrlStringThe resource.
successCallbackfunction(textAccessToken)A callback function what is called asynchronously with serialized access token as argument.
failureCallbackfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.getAppColor Function

Gets the customized color by its name.

Arguments

ArgumentTypeDescription
colNameStringDefines the color name. Must be one of these: TitleBackground, TitleForeground, ListBackground, ListForeground, ListSelBackground, ListSelForeground, ListSeparator, SearchBackground, SearchForeground, SearchSelForeground, FormBackground, FormItemBackground, FormItemForeground, FormItemLabelForeground, FormItemDisabled, FormItemLink, TabBackground, TabForeground, TabSelForeground.
successfunction(result)A callback function for successful asynchronous result. The result will carry a String object with color in CSS format (e.g. "#FF0000" for red color).
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.getAppImage Function

Gets the colorized application image. It is taken either from customization package or from application bundle.

Arguments

ArgumentTypeDescription
imageNameStringDefines the image name (e.g. "Buttons.Call.png").
colorizeStringIf the image supports colorization, this value defines the colorization color. It can be either integer with RGB value or the application color name as defined in MobileCRM.Application.getAppColor. Leave null if no colorization is desired.
successfunction(result)A callback function for successful asynchronous result. The result will carry a String object with "data:" URL containing base64-encoded colorized application image.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.getDirectories Function

Asynchronously gets the list of directories from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the Directory in the application local data.
successfunction(result)A callback function which carry the array of directories names.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.getDirectoriesAsync Function

Asynchronously gets the list of directories from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the Directory in the application local data.

MobileCRM.Application.getFiles Function

Asynchronously gets the list of files from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the Directory in the application local data.
successfunction(result)A callback function which carry the array of files names in the directory.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.getFilesAsync Function

Asynchronously gets the list of files from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the Directory in the application local data.

MobileCRM.Application.getLastSignificantTimeChange Function

[v13.3.1] Gets the last detected time change.

Arguments

ArgumentTypeDescription
successfunction()A callback function which is called in case of success. Callback will receive an object with "lastChange" date and "delta" time in sceonds.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.moveFile Function

Asynchronously moves the application local file to another location.

Arguments

ArgumentTypeDescription
srcStringDefines the relative path of the source file in the application local data.
dstStringDefines the relative path of the destination file in the application local data.
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.moveFileAsync Function

Asynchronously moves the application local file to another location.

Arguments

ArgumentTypeDescription
srcStringDefines the relative path of the source file in the application local data.
dstStringDefines the relative path of the destination file in the application local data.

MobileCRM.Application.onSyncFinished Function

[v8.1] Binds the new handler to the synchronization finish event.

Arguments

ArgumentTypeDescription
handlerfunction(homeForm)A function which will be called when the synchronization finished event occurs with current instance of the MobileCRM.UI.HomeForm as parameter.
scopeObjectA scope in which the handler should be called.

MobileCRM.Application.readFile Function

Reads the file from the application local data and asynchronously gets its content.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
successfunction(result)A callback function for successful asynchronous result. The result will carry a String object with the file content.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.readFileAsBase64 Function

Reads the file from the application local data and asynchronously gets its base64-encoded content.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
successfunction(result)A callback function for successful asynchronous result. The result will carry a string with the base64-encoded file content.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.readFileAsync Function

[v15.3] Reads the file from the application local data and asynchronously gets its content.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
encodingStringDefines the text encoding for file content (default is UTF8). Use base64 for binary files. Supported values: UTF8, UTF16 ASCII, BASE64.

MobileCRM.Application.setAppColors Function

[v11.2] Sets the application colors.

Arguments

ArgumentTypeDescription
colorsobjectProperties of the object define the colors to set. The values must be int in the AARRGGBB format.
successfunction(result)A callback function for successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.showAppLogin Function

Causes that the password is forgotten and user is required to type it again to make the app running.


MobileCRM.Application.showSetup Function

Closes all forms and shows the setup screen.


MobileCRM.Application.startSmartSync Function

Arguments

ArgumentTypeDescription
smartSyncNameStringThe name of SmartSync configuration as defined in Woodford.

Return value

Type: Promise

A Promise resolved when the SmartSync was initiated.


MobileCRM.Application.synchronize Function

Starts background/foreground sync if not synchronized or the last sync was before desired limit.

Arguments

ArgumentTypeDescription
backgroundOnlyBooleanif true, only the background sync is allowed; otherwise it can also run the foreground sync.
ifNotSyncedBeforeDateDefines a time limit required for the last sync. Starts the sync only if wasn"t done yet or if it was before this limit. If it is null or undefined, sync is done always.

MobileCRM.Application.synchronizeOnForeground Function

[v8.1] Starts the synchronization on foreground (closes all form if possible and showing the standard progress).

Foreground sync must be done to download the new customization or to display the sync conflicts.

Arguments

ArgumentTypeDescription
forceLoginBooleanif true, the sync dialog with URL and credentials will be opened; otherwise it is opened only if the password is not saved.

MobileCRM.Application.writeFile Function

Asynchronously writes the text into the file from the application local data.

File content is encoded using UTF-8 encoding.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
textStringDefines the file content to be written.
appendBooleanDetermines whether to overwrite or append to an existing file..
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.writeFileAsync Function

[v15.3] Asynchronously writes data into the file from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
textStringDefines the file content (in corresponding text encoding) to be written.
encodingStringDefines the text encoding for file content data. Use base64 for binary files. Supported values: UTF8, ASCII, BASE64.

MobileCRM.Application.writeFileFromBase64 Function

Asynchronously writes the base64-encoded data into the application local storage file.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
base64StringA string containing the base64-encoded file content.
successfunction()A callback function which is called in case of success.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Application.writeFileWithEncoding Function

[v9.0.2] Asynchronously writes the text into the file from the application local data.

Arguments

ArgumentTypeDescription
pathStringDefines the relative path of the file in the application local data.
textStringDefines the file content to be written.
encodingStringDefines the text encoding for file content (default is UTF-8). Use "ASCII" for ANSI text or "UTF-16" for multi-byte Unicode.
appendBooleanDetermines whether to overwrite or append to an existing file.
successfunction(result)A callback function which is called in case of successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Bridge Object

Provides the management of the Javascript/native code cross-calls. Its only instance MobileCRM.bridge is created immediately after the "JSBridge.js" script is loaded.

Properties

PropertyTypeDescription
platformStringA string identifying the device platform (e.g. Android, iOS, Windows, WindowsRT, Windows10 or WindowsPhone).
versionNumberA number identifying the version of the JSBridge. This is the version of the script which might not match the version of the application part of the bridge implementation. Application version must be equal or higher than the script version.

Methods

MethodDescription
alertShows a message asynchronously and calls the callback after it is closed by user.
closeFormCloses a form containing this HTML document.
enableDebugEnables platform-specific features for debugging the web page.
enableZoomEnables platform-specific pinch zoom gesture.
getWindowSize[v8.0] Returns the size of the window in logical pixels without any scaling and viewport calculations..
invokeMethodPromiseInvokes a method on exposed managed object asynchronously as a Promise.
invokeStaticMethodPromiseInvokes a static method on specified type asynchronously as a Promise.
log[v8.0] Appends a message into the JSBridge log.
onGlobalEvent[v9.0] Binds or unbinds the handler for global event.
raiseGlobalEvent[v9.0] Raises the global event which can have listeners bound by other iFrames.

MobileCRM.Bridge.alert Method

Shows a message asynchronously and calls the callback after it is closed by user.

Arguments

ArgumentTypeDescription
callbackfunction(obj)The callback function that is called asynchronously.
scopeObjectThe scope for callbacks.

MobileCRM.Bridge.closeForm Method

Closes a form containing this HTML document.


MobileCRM.Bridge.enableDebug Method

Enables platform-specific features for debugging the web page.

After calling this method, it is possible to attach the Google Chrome debugger into the web page opened in MobileCRM application running on Android (KitKat or newer).

This method also activates the Javascript warnings in Windows 7 app.

It has dummy implementation on iOS and Android debug build.

Arguments

ArgumentTypeDescription
callbackfunction(obj)The callback function that is called asynchronously.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Bridge.enableZoom Method

Enables platform-specific pinch zoom gesture.

After calling this method, it is possible to use the pinch gesture to control the content zoom. This functionality is implemented only on Android. Other platforms either do not support zoom or it is controlled by the HTML viewport meta tag.

Arguments

ArgumentTypeDescription
enableBooleanIndicates whether to enable or disable zooming support.

MobileCRM.Bridge.getWindowSize Method

[v8.0] Returns the size of the window in logical pixels without any scaling and viewport calculations..

Arguments

ArgumentTypeDescription
callbackfunction(obj)The callback function that is called asynchronously. Gets an object with the window "width" and "height".
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Bridge.invokeCommandPromise Method


MobileCRM.Bridge.invokeMethodPromise Method

Invokes a method on exposed managed object asynchronously as a Promise.

Arguments

ArgumentTypeDescription
objectNameStringThe name of exposed managed object as it was registered on C# side (IJavascriptBridge.ExposeObject).
methodStringThe name of the method implemented by object class.
paramsListArrayAn array with parameters that should be passed to a method.

Return value

Type: Promise<any>

A Promise object which will be resolved with JSON-serialized return value. It is either generic type or MobileCRM.ObservableObject with JSON-serialized return value..


MobileCRM.Bridge.invokeStaticMethodPromise Method

Invokes a static method on specified type asynchronously as a Promise.

Arguments

ArgumentTypeDescription
assemblyStringThe name of the assembly which defines the type.
typeNameStringThe full name of the C# type which implements the method.
methodStringThe name of static method to be invoked.
paramsListArrayAn array with parameters that should be passed to a method.

Return value

Type: Promise<any>

A Promise object which will be resolved with JSON-serialized return value. It is either generic type or MobileCRM.ObservableObject with JSON-serialized return value..


MobileCRM.Bridge.log Method

[v8.0] Appends a message into the JSBridge log.

Arguments

ArgumentTypeDescription
textStringA text to be written into the log.

MobileCRM.Bridge.onGlobalEvent Method

[v9.0] Binds or unbinds the handler for global event.

This methods binds or unbinds a handler which is called when this or other iFrame raises the specified event by calling the MobileCRM.bridge.raiseGlobalEvent method.

It can also bind a handler for pre-defined events EntityFormClosed, IFrameFormClosed, SyncStarted and SyncFinished.

Arguments

ArgumentTypeDescription
eventNameStringGlobal event name.
handlerfunction(args)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.Bridge.raiseGlobalEvent Method

[v9.0] Raises the global event which can have listeners bound by other iFrames.

Arguments

ArgumentTypeDescription
eventNameStringGlobal event name.
argsObjectAny object that has to be passed to all event listeners. This object is stringified JSON and passed to another iFrame listening on the global event.

MobileCRM.Configuration Object

Provides an access to the application configuration.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.Configuration.requestObject function.

Properties

PropertyTypeDescription
applicationEditionStringGets the application edition.
applicationPathStringGets the application folder.
applicationVersionStringGets the application version (major.minor.subversion.build).
customizationDirectoryStringGets or sets the runtime customization config root.
externalConfigurationStringGets the external configuration directory (either customization or legacy configuration).
isBackgroundSyncBooleanGets or sets whether background synchronization is in progress.
isOnlineBooleanGets or sets whether the online mode is currently active.
legacyVersionStringGets or sets the legacy redirect folder.
licenseAlertStringGets the flag set during sync indicating that the user's license has expired.
projectVersionStringGets customer-defined project version.
settingsMobileCRM._SettingsGets the application settings.
storageDirectoryStringGets the root folder of the application storage.

Functions

FunctionDescription
requestObjectRequests the managed Configuration object.

MobileCRM.Configuration.requestObject Function

Requests the managed Configuration object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of Configuration object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(config)The callback function that is called asynchronously with MobileCRM.Configuration object instance as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.CultureInfo Object

[v10.2] Provides information about current device culture. The information includes the names for the culture, the writing system, the calendar used, and formatting for dates.

Properties

PropertyTypeDescription
nameStringGets the culture name in the format languageCode/region (e.g. "en-US"). languageCode is a lowercase two-letter code derived from ISO 639-1. regioncode is derived from ISO 3166 and usually consists of two uppercase letters.
displayNameStringGets the full localized culture name.
nativeNameStringGets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.
localizationStringGets selected localization language.
ISONameStringGets the ISO 639-1 two-letter code for the language of the current CultureInfo.
isRightToLeftBooleanGets a value indicating whether the current CultureInfo object represents a writing system where text flows from right to left.
dateTimeFormatMobileCRM.DateTimeFormatGets a DateTimeFormat that defines the culturally appropriate format of displaying dates and times.
numberFormatMobileCRM.NumberFormatGets a NumberFormat that defines the culturally appropriate format of displaying numbers, currency, and percentage.

Functions

FunctionDescription
formatDate[v10.2] Returns the formatted date/time string that matches current device culture.
fullDateTimeString[v10.2] Returns the date and time string that matches current device culture.
initialize[v10.2] Initializes the CultureInfo object.
initializeAsync[v10.2] Initializes the CultureInfo object.
load[v10.2] Asynchronously gets the CultureInfo object for specified language/country.
loadAsync[v10.2] Asynchronously gets the CultureInfo object for specified language/country.
longDateString[v10.2] Returns the long date string that matches current device culture.
longTimeString[v10.2] Returns the long time string that matches current device culture.
monthDayString[v10.2] Returns the month and day string that matches current device culture.
shortDateString[v10.2] Returns the short date string that matches current device culture.
shortTimeString[v10.2] Returns the short time string that matches current device culture.
yearMonthString[v10.2] Returns the year and month string that matches current device culture.

MobileCRM.CultureInfo.formatDate Function

[v10.2] Returns the formatted date/time string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.
formatStringCustom format string that meets the MSDN Sepcification.

MobileCRM.CultureInfo.fullDateTimeString Function

[v10.2] Returns the date and time string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.initialize Function

[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.

Arguments

ArgumentTypeDescription
callbackfunction(currentCulture)The callback function that is called asynchronously with initialized CultureInfo object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is to be called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.CultureInfo.initializeAsync Function

[v10.2] Initializes the CultureInfo object.

Method loads the current culture information asynchronously.

All other functions will return the default or empty string before the initialization promise is resolved.

Return value

Type: Promise<MobileCRM.CultureInfo>

A Promise object which will be resolved with the loaded CultureInfo object.


MobileCRM.CultureInfo.load Function

[v10.2] Asynchronously gets the CultureInfo object for specified language/country.

Arguments

ArgumentTypeDescription
cultureStringThe name of culture that has to be loaded. The culture name is in the format language code-country where language code is a lowercase two-letter code derived from ISO 639-1. country is derived from ISO 3166 and usually consists of two uppercase letters
callbackfunction(cultureInfo)The callback function that is called asynchronously with initialized CultureInfo object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is to be called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.CultureInfo.loadAsync Function

[v10.2] Asynchronously gets the CultureInfo object for specified language/country.

Arguments

ArgumentTypeDescription
cultureStringThe name of culture that has to be loaded. The culture name is in the format language code-country where language code is a lowercase two-letter code derived from ISO 639-1. country is derived from ISO 3166 and usually consists of two uppercase letters

Return value

Type: Promise<MobileCRM.CultureInfo>

A Promise object which will be resolved with the loaded CultureInfo object.


MobileCRM.CultureInfo.longDateString Function

[v10.2] Returns the long date string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.longTimeString Function

[v10.2] Returns the long time string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.monthDayString Function

[v10.2] Returns the month and day string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.shortDateString Function

[v10.2] Returns the short date string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.shortTimeString Function

[v10.2] Returns the short time string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.CultureInfo.yearMonthString Function

[v10.2] Returns the year and month string that matches current device culture.

This method fails if CultureInfo.initialize method hasn't completed yet.

Arguments

ArgumentTypeDescription
dateDateA date being formatted.

MobileCRM.DateTimeFormat Object

[v10.2] Provides culture-specific information about the format of date and time values.

Properties

PropertyTypeDescription
abbreviatedDayNamesString[]Gets a string array containing the culture-specific abbreviated names of the days of the week.
abbreviatedMonthGenitiveNamesString[]Gets a string array of abbreviated month names associated with the current DateTimeFormat object.
abbreviatedMonthNamesString[]Gets a string array that contains the culture-specific abbreviated names of the months.
aMDesignatorStringGets the string designator for hours that are "ante meridiem" (before noon).
dayNamesString[]Gets a string array that contains the culture-specific full names of the days of the week.
firstDayOfWeekNumberGets the first day of the week (0=Sunday, 1=Monday, ...)
fullDateTimePatternStringGets the custom format string for a long date and long time value.
longDatePatternStringGets the custom format string for a long date value.
longTimePatternStringGets the custom format string for a long time value.
monthDayPatternStringGets the custom format string for a month and day value.
monthGenitiveNamesString[]Gets a string array of month names associated with the current DateTimeFormat object.
monthNamesString[]Gets a string array containing the culture-specific full names of the months.
pMDesignatorStringGets the string designator for hours that are "post meridiem" (after noon).
shortDatePatternStringGets the custom format string for a short date value.
shortestDayNamesString[]Gets a string array of the shortest unique abbreviated day names associated with the current DateTimeFormat object.
shortTimePatternStringGets the custom format string for a short time value.
sortableDateTimePatternStringGets the custom format string for a sortable date and time value.
universalSortableDateTimePatternStringGets the custom format string for a universal, sortable date and time string.
yearMonthPatternStringGets the custom format string for a year and month value.

MobileCRM.DynamicEntity Object

Represents a CRM entity, with only a subset of properties loaded.

This class is derived from MobileCRM.Reference

There is a compatibility issue since the version 7.4 which gets the boolean and numeric properties as native Javascript objects (instead of strings). If you experienced problems with these types of fields, switch on the legacy serialization by setting the static property MobileCRM.DynamicEntity.legacyPropsSerialization to true.

Properties

PropertyTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.
isNewBooleanIndicates whether the entity is newly created.
isOnlineBooleanIndicates whether the entity was created by online request or from local data.
forceDirtyBooleanIndicates whether to force save the provided properties even if not modified. Default behavior is to save only properties that were modified.
primaryNameStringThe human readable name of the entity, e.g. "Alexandro".
propertiesObjectAn object with entity properties, e.g. {firstname:"Alexandro", lastname:"Puccini"}.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.DynamicEntity object.
savePerforms the asynchronous CRM create/modify entity command.
saveAsyncPerforms the asynchronous CRM create/modify entity command.

Functions

FunctionDescription
createNewCreates the MobileCRM.DynamicEntity object representing new entity.
deleteAsyncAsynchronously deletes the CRM entity.
deleteByIdAsynchronously deletes the CRM entity.
deleteMultipleSaves an entity instance to storage.Where the entity is stored is determined by how it was loaded: online / offline.
downloadAttachment[v9.1] Initiates the attachment download for specified entity.
downloadAttachmentAsync[v9.1] Initiates the attachment download for specified entity.
loadAsyncAsynchronously loads the CRM entity properties.
loadByIdAsynchronously loads the CRM entity properties.
loadDocumentBodyAsynchronously loads the document body for specified entity.
loadDocumentBodyAsyncAsynchronously loads the document body for specified entity.
loadFileFieldContent
saveDocumentBody[v10.0]Asynchronously saves the document body for specified entity.
saveDocumentBodyAsync[v10.0]Asynchronously saves the document body for specified entity.
saveMultipleSaves an entities instances to storage.Where the entity is stored is determined by how it was loaded: online / offline.
unzipDocumentBody[v9.1] Asynchronously unpacks the document body (assumes it's a zip file) for specified entity.

MobileCRM.DynamicEntity.constructor Method

Constructs an instance of MobileCRM.DynamicEntity object.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.
primaryNameStringThe human readable name of the entity, e.g "Alexandro".
propertiesObjectAn object with entity properties, e.g. {firstname:"Alexandro", lastname:"Puccini"}.
isOnlineBooleanIndicates whether the entity was created by online request or from local data.
isNewBooleanIndicates whether the entity is newly created.

MobileCRM.DynamicEntity.save Method

Performs the asynchronous CRM create/modify entity command.

Arguments

ArgumentTypeDescription
callbackfunction(err)A callback function for asynchronous result. The err argument will carry the error message or null in case of success. The callback is called in scope of DynamicEntity object which is being saved.
forceModeBoolean[v10.0.2] Optional parameter which forces online/offline mode for saving. Set "true" to save entity online; "false" to save it offline. Any other value (including "undefined") causes entity tobe saved in currently selected application offline/online mode.

MobileCRM.DynamicEntity.saveAsync Method

Performs the asynchronous CRM create/modify entity command.

Arguments

ArgumentTypeDescription
forceModeBooleanOptional parameter which forces online/offline mode for saving. Set "true" to save entity online; "false" to save it offline. Any other value (including "undefined") causes entity to be saved in currently selected application offline/online mode.

Return value

Type: Promise<DynamicEntity>

A Promise object which will be resolved with saved DynamicEntity object as result.


MobileCRM.DynamicEntity.createNew Function

Creates the MobileCRM.DynamicEntity object representing new entity.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.
primaryNameStringThe human readable name of the entity, e.g "Alexandro".
propertiesObjectAn object with entity properties, e.g. {firstname:"Alexandro", lastname:"Puccini"}.

MobileCRM.DynamicEntity.deleteAsync Function

Asynchronously deletes the CRM entity.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.

Return value

Type: Promise<void>

A Promise object which will be resolved after the entity record is deleted.


MobileCRM.DynamicEntity.deleteById Function

Asynchronously deletes the CRM entity.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.
successfunction()A callback function for successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.deleteMultiple Function

Saves an entity instance to storage.Where the entity is stored is determined by how it was loaded: online / offline.

Arguments

ArgumentTypeDescription
deletedEntitiesMobileCRM.DynamicEntity[]Array of MobileCRM.DynamicEntity or MobileCRM.Reference what will be deleted.
sucessCallbacakfunction(result)A callback function for successful asynchronous result.
failureCallbackfunction(error)A callback function for command failure. The error argument will carry the error message.
onlineBooleanWhether to load and save online or offline. Null for default mode defined by current configuration.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.downloadAttachment Function

[v9.1] Initiates the attachment download for specified entity.

Function sends an asynchronous request to application, which downloads the document body (e.g. the annotation) from server and sends it back to the Javascript callback.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, in most cases "annotation".
idStringGUID of the existing entity or null for new one.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the string with base64-encoded data.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.downloadAttachmentAsync Function

[v9.1] Initiates the attachment download for specified entity.

Function sends an asynchronous request to application, which downloads the document body (e.g. the annotation) from server and resolves pending Javascript promise.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, in most cases "annotation".
idStringGUID of the existing entity or null for new one.

Return value

Type: Promise<string>

A Promise object which will be resolved with base64-encoded data string.


MobileCRM.DynamicEntity.loadAsync Function

Asynchronously loads the CRM entity properties.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.

Return value

Type: Promise<MobileCRM.DynamicEntity>

A Promise object which will be resolved with an instance of DynamicEntity object representing entity record.


MobileCRM.DynamicEntity.loadById Function

Asynchronously loads the CRM entity properties.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, e.g. "account".
idStringGUID of the existing entity or null for new one.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the MobileCRM.DynamicEntity object.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.loadDocumentBody Function

Asynchronously loads the document body for specified entity.

Function sends an asynchronous request to application, where the locally stored document body (e.g. the annotation.documentbody) is encoded to base64 and sent back to the Javascript callback. This function supports both online data and the data stored in local database/BLOB store.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, in most cases "annotation".
idStringGUID of the existing entity or null for new one.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the string with base64-encoded data.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.loadDocumentBodyAsync Function

Asynchronously loads the document body for specified entity.

Function sends an asynchronous request to application, where the locally stored document body (e.g. the annotation.documentbody) is encoded to base64 and pending Javascript promise is resolved. This function supports both online data and the data stored in local database/BLOB store.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, in most cases "annotation".
idStringGUID of the existing entity or null for new one.

Return value

Type: Promise<string>

A Promise object which will be resolved with base64-encoded data string.


MobileCRM.DynamicEntity.loadFileFieldContent Function

Arguments

ArgumentTypeDescription
entityNameStringLogical name of entity containing the file field.
idStringAn ID of record containing the file field.
fileFieldNameStringLogical name of the file field.

MobileCRM.DynamicEntity.saveDocumentBody Function

[v10.0]Asynchronously saves the document body for specified entity.

Function sends an asynchronous request to application, where the locally stored document body (e.g. the annotation.documentbody) is saved.

Arguments

ArgumentTypeDescription
entityIdStringGUID of the existing entity or "null" for new one.
entityNameStringThe logical name of the entity; optional, default is "annotation".
relationshipMobileCRM.RelationshipThe relationship with parent object.
filePathStringAbsolute or app data-relative path to the file holding the body.
mimeTypeStringMimeType of the content, optional.
successfunction(MobileCRM.Reference)A callback function for successful asynchronous result. The result argument will carry the Reference to updated/created entity.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.saveDocumentBodyAsync Function

[v10.0]Asynchronously saves the document body for specified entity.

Function sends an asynchronous request to application, where the locally stored document body (e.g. the annotation.documentbody) is saved.

Arguments

ArgumentTypeDescription
entityIdStringGUID of the existing entity or "null" for new one.
entityNameStringThe logical name of the entity; optional, default is "annotation".
relationshipMobileCRM.RelationshipThe relationship with parent object.
filePathStringAbsolute or app data-relative path to the file holding the body.
mimeTypeStringMimeType of the content, optional.

Return value

Type: Promise<MobileCRM.Reference>

A Promise object which will be resolved with the Reference object representing updated/created entity.


MobileCRM.DynamicEntity.saveMultiple Function

Saves an entities instances to storage.Where the entity is stored is determined by how it was loaded: online / offline.

Arguments

ArgumentTypeDescription
updatedEntitiesMobileCRM.DynamicEntity[]Array of MobileCRM.DynamicEntity.
onlineBooleanWhether to load and save online or offline. Null for default mode defined by current configuration.
sucessCallbacakfunction(result)A callback function for successful asynchronous result.
failureCallbackfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.DynamicEntity.unzipDocumentBody Function

[v9.1] Asynchronously unpacks the document body (assumes it's a zip file) for specified entity.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the entity, in most cases the "annotation".
idStringGUID of the existing entity or null for new one.
targetDirStringThe relative path of the target directory within the application storage.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the string with base64-encoded data.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.GlobalConstants Object

Provides access to the global constants.

Functions

FunctionDescription
getAllAsyncAsynchronously returns the JSON object representing the GlobalConstants variables.
getAsyncAsynchronously returns the constant associated with the specified key in the GlobalConstants variables.

MobileCRM.GlobalConstants.getAllAsync Function

Asynchronously returns the JSON object representing the GlobalConstants variables.

Return value

Type: Promise<Object>

A Promise object that will be resolved with the properties representing the constant variables.


MobileCRM.GlobalConstants.getAsync Function

Asynchronously returns the constant associated with the specified key in the GlobalConstants variables.

Arguments

ArgumentTypeDescription
keyStringThe key of the constant to get.

Return value

Type: Promise<Object>

A Promise object that will be resolved with an object representing the constant variable.


MobileCRM.Localization Object

A static object with functions allowing to access the localized texts.

Functions

FunctionDescription
getGets the display string for the passed id.
getComponentLabelGets the display string for the passed entity and component (view, form) id.
getLoadedLangIdAsynchronously gets currently loaded localization language.
getPluralGets the plural version of the display string for the passed id.
getTextOrDefaultGets the display string for the passed id, or the passed default string if a string with the passed id doesn't exists.
initializeInitializes the Localization object.
initializeAsync[v10.0] Initializes the Localization object.
initializeEx[v10.0] Initializes the Localization object.
makeIdCreates an absolute id from section and id.

MobileCRM.Localization.get Function

Gets the display string for the passed id.

Arguments

ArgumentTypeDescription
idStringDisplay string id.

Return value

Type: String

Human readable string label.


MobileCRM.Localization.getComponentLabel Function

Gets the display string for the passed entity and component (view, form) id.

Arguments

ArgumentTypeDescription
entityNameStringThe entity logical name.
componentTypeStringThe component type. (View, DetailView).
viewNameStringThe component id

Return value

Type: String

The component label.


MobileCRM.Localization.getLoadedLangId Function

Asynchronously gets currently loaded localization language.

The default language is "en-US".

Arguments

ArgumentTypeDescription
callbackfunction(langId)The callback function that is called asynchronously with currently loaded localization language as argument.
errorCallbackfunction(errorMsg)The errorCallback which is to be called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Localization.getPlural Function

Gets the plural version of the display string for the passed id.

Arguments

ArgumentTypeDescription
idStringDisplay string id.

Return value

Type: String

Human readable plural string label.


MobileCRM.Localization.getTextOrDefault Function

Gets the display string for the passed id, or the passed default string if a string with the passed id doesn't exists.

Arguments

ArgumentTypeDescription
idStringDisplay string id.
defaultStringStringDefault display string.

Return value

Type: String

Human readable string label.


MobileCRM.Localization.initialize Function

Initializes the Localization object.

Method loads the string table asynchronously and calls either the errorCallback with error message or the callback with initialized Localization object.

All other functions will return the default or empty string before the initialization finishes.

Arguments

ArgumentTypeDescription
callbackfunction(config)The callback function that is called asynchronously with initialized Localization object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is to be called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Localization.initializeAsync Function

[v10.0] Initializes the Localization object.

Method loads the string table asynchronously and resolves pending promise with initialized Localization object.

All other functions will return the default or empty string before the initialization finishes.

Arguments

ArgumentTypeDescription
regularExpressionstringOptional regular expression defining a subset of localization keys. Refer to Regular Expression Language - Quick Reference. Set to null to obtain whole localization.

Return value

Type: Promise<MobileCRM.Localization>

A Promise object which will be resolved with initialized Localization object as argument.


MobileCRM.Localization.initializeEx Function

[v10.0] Initializes the Localization object.

Method loads the string table asynchronously and calls either the errorCallback with error message or the callback with initialized Localization object.

All other functions will return the default or empty string before the initialization finishes.

Arguments

ArgumentTypeDescription
regularExpressionstringThe regular expression defining a subset of localization keys. Refer to Regular Expression Language - Quick Reference. Set to null to obtain whole localization.
callbackfunction(config)The callback function that is called asynchronously with initialized Localization object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is to be called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Localization.makeId Function

Creates an absolute id from section and id.

Arguments

ArgumentTypeDescription
sectionStringThe section id.
idStringDisplay string id.

Return value

Type: String

Absolute id.


MobileCRM.ManyToManyReference Object

A static object with functions managing many to many relations.

Functions

FunctionDescription
addRecordAdds or removes an N-N relationship record between the two passed entities.
createCreates a new N-N relationship between the two passed entities.
removeRemoves an existing N-N relationship between the two passed entities.

MobileCRM.ManyToManyReference.addRecord Function

Adds or removes an N-N relationship record between the two passed entities.

Arguments

ArgumentTypeDescription
entityNameStringThe relationship entity name.
ref1MobileCRM.ReferenceFirst entity instance.
ref2MobileCRM.ReferenceSecond entity instance.
createBooleanWhether to create or delete the relationship record.
successfunction(result)A callback function for successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.ManyToManyReference.create Function

Creates a new N-N relationship between the two passed entities.

New relationship is created either in local database or using the online request. It depends on current application mode.

Arguments

ArgumentTypeDescription
entityNameStringThe relationship entity name.
ref1MobileCRM.ReferenceFirst entity instance.
ref2MobileCRM.ReferenceSecond entity instance.
successfunction(result)A callback function for successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.ManyToManyReference.remove Function

Removes an existing N-N relationship between the two passed entities.

Relationship is removed either from local database or using the online request. It depends on current application mode.

Arguments

ArgumentTypeDescription
entityNameStringThe relationship entity name.
ref1MobileCRM.ReferenceFirst entity instance.
ref2MobileCRM.ReferenceSecond entity instance.
successfunction(result)A callback function for successful asynchronous result.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.MetaEntity Object

Represents an entity metadata.

Properties

PropertyTypeDescription
isEnabledBooleanIndicates whether an entity is enabled. This field is used for limited runtime customization.
isExternalBooleanIndicates whether an entity stores data from external sources Exchange/Google.
nameStringGets the entity (logical) name.
objectTypeCodeNumberGets the unique entity type code.
primaryFieldNameStringThe name of the entity primary field (name) property.
primaryKeyNameStringThe name of the entity primary key property.
relationshipNameStringGets the name of the many-to-many relationship name. Defined only for intersect entities.
statusFieldNameStringGets the status property name. In general it is called "statuscode" but there are exceptions.
uploadOnlyBooleanIndicates whether this entity can be downloaded during synchronization.
attributesNumberGets additional entity attributes.

Methods

MethodDescription
canAppendToChecks whether the user has permission to append a child To a this parent entity.
canCreateChecks whether the current user has create permission on the entity type.
canDeleteChecks whether the current user has create permission on the entity type.
canReadChecks whether the current user has read permission on the entity type.
canWriteChecks whether the current user has write permission on the entity type.
getDepthGets the permission depth.
getPropertyGets the MetaProperty object describing the CRM attribute (field) properties.

Functions

FunctionDescription
loadByNameGets the MetaEntity by its name.

MobileCRM.MetaEntity.canAppendTo Method

Checks whether the user has permission to append a child To a this parent entity.

Arguments

ArgumentTypeDescription
childStringThe entity to append (f.e. opportunity).

Return value

Type: Boolean

True if the user has append permissions, false otherwise.


MobileCRM.MetaEntity.canCreate Method

Checks whether the current user has create permission on the entity type.

Return value

Type: Boolean

True if the permission is granted, false otherwise.


MobileCRM.MetaEntity.canDelete Method

Checks whether the current user has create permission on the entity type.

Return value

Type: Boolean

True if the permission is granted, false otherwise.


MobileCRM.MetaEntity.canRead Method

Checks whether the current user has read permission on the entity type.

Return value

Type: Boolean

True if the permission is granted, false otherwise.


MobileCRM.MetaEntity.canWrite Method

Checks whether the current user has write permission on the entity type.

Return value

Type: Boolean

True if the permission is granted, false otherwise.


MobileCRM.MetaEntity.getDepth Method

Gets the permission depth.

Arguments

ArgumentTypeDescription
permissionNumberPermission to check.

Return value

Type: Number

The permission depth (none, user, business unit, organization).


MobileCRM.MetaEntity.getProperty Method

Gets the MetaProperty object describing the CRM attribute (field) properties.

Arguments

ArgumentTypeDescription
nameStringA logical name of the CRM field.

Return value

Type: MobileCRM.MetaProperty

An instance of the MobileCRM.MetaProperty object or "null".


MobileCRM.MetaEntity.loadByName Function

Gets the MetaEntity by its name.

If you only need to know the attributes of a single entity, use this method to prevent requesting all Metadata information.

Arguments

ArgumentTypeDescription
nameStringA logical name of requested entity.
callbackfunctionThe callback function that is called asynchronously with MetaEntity object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.MetaProperty Object

Represents a property (CRM field) metadata.

Properties

PropertyTypeDescription
nameStringGets the field (logical) name.
requiredNumberGets the attribute requirement level (0=None, 1=SystemRequired, 2=Required, 3=Recommended, 4=ReadOnly).
typeNumberGets the attribute CRM type (see MS Dynamics SDK).
formatNumberGets the attribute display format.
isVirtualBooleanGets whether the property is virtual (has no underlying storage). State and PartyList properties are virtual.
isReferenceBooleanGets whether the property is a reference (lookup) to another entity.
isNullableBooleanGets whether the property may contain NULL.
defaultValueGets the property default value.
targetsArrayGets the names of target entities, if the property is a lookup, or customer.
minimumNumberGets the attribute minimum value.
maximumNumberGets the attribute minimum value.
precisionNumberGets the numeric attribute's precision (decimal places).
permissionNumberGets the attribute's permission set (0=None, 1=User, 2=BusinessUnit, 4=ParentChild, 8=Organization).
activityPartyTypeNumberGets the activity party type (from, to, attendee, etc.)
isMultiPartyBooleanGets whether the activity party property can have multiple values (multiple to, cc, resources.)
isSingularPartyBooleanGets whether the property represents a singular activity party property. These properties exists as both a Lookup property on the entity and an ActivytParty record.

MobileCRM.Metadata Object

A static object with functions for accessing the entity metadata store.

Functions

FunctionDescription
entityHasChildrenGets whether the passed entity has child entities.
getActivitiesGets the list of activities.
getEntityGets the MetaEntity object describing the entity attributes.
getEntityParentGets the entity's parent entity name.
getOptionSetValuesAsynchronously gets the list of values for given CRM OptionSet.
getStringListOptionsGets the list of options for the string list property.
requestObjectRequests the Metadata object containing the list of MetaEntities which are enabled for current mobile project.

MobileCRM.Metadata.entityHasChildren Function

Gets whether the passed entity has child entities.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.

Return value

Type: Boolean

True if the entity is a parent, false otherwise.


MobileCRM.Metadata.getActivities Function

Gets the list of activities.

It&s required to request the Metadata object prior to using this object. See MobileCRM.Metadata.requestObject.

Return value

Type: Array

An array of entity names.


MobileCRM.Metadata.getEntity Function

Gets the MetaEntity object describing the entity attributes.

It's required to request the Metadata object prior to using this object. See MobileCRM.Metadata.requestObject.

Arguments

ArgumentTypeDescription
nameStringA name of MetaEntity.

Return value

Type: MobileCRM.MetaEntity

A MobileCRM.MetaEntity object or "undefined".


MobileCRM.Metadata.getEntityParent Function

Gets the entity's parent entity name.

Arguments

ArgumentTypeDescription
childEntityNameStringThe entity name.

Return value

Type: String

The parent entity name, or "undefined" if N/A.


MobileCRM.Metadata.getOptionSetValues Function

Asynchronously gets the list of values for given CRM OptionSet.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
optionSetNameStringThe OptionSet name.
callbackfunction(optionSetValues)The callback function that is called asynchronously with option set values object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Metadata.getStringListOptions Function

Gets the list of options for the string list property.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
propertyNameStringThe string list property name.

MobileCRM.Metadata.requestObject Function

Requests the Metadata object containing the list of MetaEntities which are enabled for current mobile project.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of Metadata object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(metadata)The callback function which is called asynchronously with serialized EntityForm object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.MobileReport Object

Provides a functionality of mobile reporting.

Functions

FunctionDescription
GenerateReportRequest[v18.0] The request class specifying behavior of MobileCRM.MobileReport.generateReportAsync function.
GenerateReportResult[v18.0] The result class for MobileCRM.MobileReport.generateReportAsync function.
generateReportAsync[v18.0] Generates the mobile report based on provided request parameters. The generated report will be saved to file system or attached to a record.
runReport[v9.1] Deprecated: please use MobileCRM.MobileReport.generateReportAsync instead. Executes the mobile reporting request which produces the mobile report document of given format.
runReportAsync[v9.1] Deprecated: please use MobileCRM.MobileReport.generateReportAsync instead. Executes the mobile reporting request which produces the mobile report document of given format.
showForm[v10.1] Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.
showFormWithConfiguration[v16.0] Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.

MobileCRM.MobileReport.GenerateReportRequest Function

[v18.0] The request class specifying behavior of MobileCRM.MobileReport.generateReportAsync function.

Arguments

ArgumentTypeDescription
sourceString | MobileCRM.ReferenceThe identifier of report source record(s) as MobileCRM.Reference or fetch in its xml representation.
templateString | MobileCRM.ReferenceThe identifier of report template as its string record ID, exact logical name, MobileCRM.Reference or actual xml definition of report.
formatStringOptional code of report format. Supported values are: Pdf (default), Html, Excel, Word.
customNameOrPathStringOptional custom name of report file or its full path. If not provided, default report name and path are used. When using full path, it is recommended to place it in MobileCRM.Configuration.storageDirectory.
languageCodeStringOptional iso code (e.g. "en-US") of report language. Currently it only works for reports on localized Questionnaires.
waitMessageStringOptional custom message displayed to user while report is being generated. When null or empty string is provided, default message is shown. When undefined, shows no wait message.
isOnlineBooleanOptionally specifies if report should be created in Online, or Offline mode. If undefined, the mode in which app is currently running is used.
attachToMobileCRM.ReferenceA MobileCRM.Reference to parent record. If provided, method will generate new attachment record and link it to the parent record.
attachmentEntityStringWhen attachmentRecord is provided, optionally specifies the type of attachment entity. If not specified, the default attachment entity is created.

MobileCRM.MobileReport.GenerateReportResult Function

[v18.0] The result class for MobileCRM.MobileReport.generateReportAsync function.

Arguments

ArgumentTypeDescription
outputReportPathStringThe full file path to generated report. Not present if MobileCRM.MobileReport.GenerateReportRequest.attachTo is provided.
attachmentRecordMobileCRM.ReferenceThe reference to attachment record containing the generated report. Only present if MobileCRM.MobileReport.GenerateReportRequest.attachTo is provided.

MobileCRM.MobileReport.generateReportAsync Function

[v18.0] Generates the mobile report based on provided request parameters. The generated report will be saved to file system or attached to a record.

Arguments

ArgumentTypeDescription
requestMobileCRM.MobileReport.GenerateReportRequestThe request specifying the details of how the report will be created.

Return value

Type: MobileCRM.MobileReport.GenerateReportResult

The promise with GenerateReportResult object.


MobileCRM.MobileReport.runReport Function

[v9.1] Deprecated: please use MobileCRM.MobileReport.generateReportAsync instead. Executes the mobile reporting request which produces the mobile report document of given format.

Arguments

ArgumentTypeDescription
fetchStringThe fetch XML defining the entity (entities) query used as report input.
reportXMLStringThe mobile report XML definition which can be loaded from the resco_report entity or constructed dynamically. Ignored if IsExportOnly parameter is true.
reportFormatStringReport format: Pdf (default), Html, Excel, Word.
isExportOnlyBooleanIf true then ReportXml is optional. The default is false.
isOnlineBooleanIndicates whether the report should be run against the online data or local database. The default is current application mode.
outputFileStringThe full path to the output file. If omitted a temp file is created. The output path is always passed to the success callback.
successfunction(obj)A callback function that is called with the file path to successfully created report.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.MobileReport.runReportAsync Function

[v9.1] Deprecated: please use MobileCRM.MobileReport.generateReportAsync instead. Executes the mobile reporting request which produces the mobile report document of given format.

Arguments

ArgumentTypeDescription
fetchStringThe fetch XML defining the entity (entities) query used as report input.
reportXMLStringThe mobile report XML definition which can be loaded from the resco_mobilereport entity or constructed dynamically. Ignored if IsExportOnly parameter is true.
reportFormatStringReport format: Pdf (default), Html, Excel, Word.
isExportOnlyBooleanIf true then ReportXml is optional. The default is false.
isOnlineBooleanIndicates whether the report should be run against the online data or local database. The default is current application mode.
outputFileStringThe full path to the output file. If omitted a temp file is created.

Return value

Type: Promise<string>

A Promise object which will be resolved with the file path to successfully created report.


MobileCRM.MobileReport.showForm Function

[v10.1] Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.

If both types of source are passed, user can select which one to use.

This method is not available under Essential license.

Arguments

ArgumentTypeDescription
reportMobileCRM.ReferenceOptional reference to the resco_mobilereport entity that will be pre-selected.
sourceMobileCRM.Reference[]The list of entity references used as report input.
fetchXMLStringThe fetch XML defining the entity (entities) query used as report input.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.MobileReport.showFormWithConfiguration Function

[v16.0] Shows new MobileReport form. Source for the report can be defined either as list of MobileCRM.Reference objects or as FetchXML query.

If both types of source are passed, user can select which one to use.

This method is not available under Essential license.

Arguments

ArgumentTypeDescription
reportMobileCRM.ReferenceOptional reference to the resco_mobilereport entity that will be pre-selected.
sourceMobileCRM.Reference[]The list of entity references used as report input.
fetchXMLStringThe fetch XML defining the entity (entities) query used as report input.
paramStringStringRun report form Configuration string in JSON format.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.NumberFormat Object

[v10.2] Provides culture-specific information for formatting and parsing numeric values.

Properties

PropertyTypeDescription
currencyDecimalDigitsNumberGets the number of decimal places to use in currency values.
currencyDecimalSeparatorStringGets the string to use as the decimal separator in currency values.
currencyGroupSeparatorStringGets the string that separates groups of digits to the left of the decimal in currency values.
currencyGroupSizesNumber[]Gets the number of digits in each group to the left of the decimal in currency values.
currencyNegativePatternNumberGets the format pattern for negative currency values.
currencyPositivePatternNumberGets the format pattern for positive currency values.
currencySymbolStringGets the string to use as the currency symbol.
naNSymbolStringGets the string that represents the IEEE NaN (not a number) value.
negativeInfinitySymbolStringGets the string that represents negative infinity.
negativeSignStringGets the string that denotes that the associated number is negative.
numberDecimalDigitsNumberGets the number of decimal places to use in numeric values.
numberDecimalSeparatorStringGets the string to use as the decimal separator in numeric values.
numberGroupSeparatorStringGets the string that separates groups of digits to the left of the decimal in numeric values.
numberGroupSizesNumber[] Gets the number of digits in each group to the left of the decimal in numeric values.
numberNegativePatternNumberGets the format pattern for negative numeric values.
percentDecimalDigitsNumberGets the number of decimal places to use in percent values.
percentDecimalSeparatorStringGets the string to use as the decimal separator in percent values.
percentGroupSeparatorStringGets the string that separates groups of digits to the left of the decimal in percent values.
percentGroupSizesNumber[]Gets the number of digits in each group to the left of the decimal in percent values.
percentNegativePatternNumberGets the format pattern for negative percent values.
percentPositivePatternNumberGets the format pattern for positive percent values.
percentSymbolStringGets the string to use as the percent symbol.
perMilleSymbolStringGets the string to use as the per mille symbol.
positiveInfinitySymbolStringGets the string that represents positive infinity.
positiveSignStringGets the string that denotes that the associated number is positive.

MobileCRM.OAuthSettings Object

[v12.4] Represents the settings what are used to authenticate using OAuth server account.

Properties

PropertyTypeDescription
authorityEndPointStringGets or sets the OAuth token url.
authorizationUrlStringGets or sets the authorization url to get authorization code.
clientIdStringGets or sets the authentication Client Id.
clientSecretStringGets or sets the Authentication Client Secret.
redirectUrlStringGets or sets the authorization redirect url for service.
resourceUrlStringGets or sets the App ID URI of the target web API (secured resource).
scopesStringGets or sets the scope to limit an application's access to a user's account.

MobileCRM.ObservableObject Object

Represents a generic object which is monitoring the changes of its properties.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.ObservableObject object.
addPropCreates a new observable property for this object
getChangedCreates a clone of this object containing all properties that were changed since object construction.
runCallbackInvokes callback passing this instance of ObservableObject as argument.
setTypedValue[v8.0] Sets the explicitly typed value for specified property.

MobileCRM.ObservableObject.constructor Method

Constructs an instance of MobileCRM.ObservableObject object.

Arguments

ArgumentTypeDescription
propsObjectOptional list of properties.

MobileCRM.ObservableObject.addProp Method

Creates a new observable property for this object

Arguments

ArgumentTypeDescription
nameStringA name of the new property.
writableBooleanIndicates whether the property should have setter.
valueAn initial value.

MobileCRM.ObservableObject.getChanged Method

Creates a clone of this object containing all properties that were changed since object construction.

This method enumerates object recursively and creates the object clone containing only the changed properties.

Return value

Type: Object

An object clone containing all changed properties.


MobileCRM.ObservableObject.runCallback Method

Invokes callback passing this instance of ObservableObject as argument.

Arguments

ArgumentTypeDescription
callbackfunctionThe callback function.
scopeObjectThe scope for callback.

Return value

Type: Object

An object clone containing all properties changed during the callback call.


MobileCRM.ObservableObject.setTypedValue Method

[v8.0] Sets the explicitly typed value for specified property.

Arguments

ArgumentTypeDescription
propNameStringThe name of the property which is being set.
typeStringThe fully qualified .Net type (e.g. "System.String" or "MobileCrm.Data.IReference,MobileCrm.Data").
valueThe value which has to be set.

MobileCRM.Platform Object

Represents object for querying platform specific information and executing platform integrated actions.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.Platform.requestObject function.

Properties

PropertyTypeDescription
capabilitiesNumberGets the mask of capability flags supported by this device (MakePhoneCalls=1; HasMapView=2).
deviceIdentifierStringGets the unique identifier of this device.
screenWidthNumberGets the current screen width in pixels.
screenHeightNumberGets the current screen width in pixels.
screenDensityNumberGets the screen density (DPI).
isMultiPanelBooleanGets whether the device has tablet or phone UI.
customImagePathStringGets or sets the custom image path that comes from customization.

Functions

FunctionDescription
email[v8.1] Opens the platform-specific e-mail message form with pre-filled data.
emailWithAttachments[v9.1] Sends a list of files (full paths or IReferences to blobs) as email attachments.
getDeviceInfoGets the device information.
getLocationGets current geo-location from platform-specific location service.
getLocationAsyncGets current geo-location from platform-specific location service.
getNetworkInfo[v11.2] Gets network information.
getURLGets the full URL of currently loaded HTML document.
makeCall[v8.0] Opens the platform-specific call application with specified phone number.
navigateToExecute the navigateTo function based on the latitude and longitude.
openDocument[v8.1] Opens specified document in associated program.
openUrlOpen url in external browser.
preventBackButtonPrevents application to close when HW back button is pressed and installs handler which is called instead.
requestObjectRequests the managed Platform object.
scanBarCodeActivates the bar-code scanning.
scanBarCodeRequiredLengthActivates the bar-code scanning.
sendEmail[v15.0] Opens the platform-specific e-mail message form with pre-filled data.
sendSMS[v11.2.3] Opens the platform-specific sms application with specified phone number and pre-fill text.
showAlertShows a platform-specific alert window with specified text and buttons. Resolves to the pressed button name.
showToastShows a platform-specific toast window over the app window which is dismissed after a few seconds.
watchLocationUpdates[v18.2] Registers or unregisters a handler for location updates.

MobileCRM.Platform.email Function

[v8.1] Opens the platform-specific e-mail message form with pre-filled data.

Arguments

ArgumentTypeDescription
addressStringRecipient's email address.
subjectStringAn e-mail subject.
bodyStringA string with email body.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.emailWithAttachments Function

[v9.1] Sends a list of files (full paths or IReferences to blobs) as email attachments.

This method either open the CRM Email form or the native mail client (depending on application settings).

Arguments

ArgumentTypeDescription
addressStringRecipient"s email address.
subjectStringAn e-mail subject.
bodyStringA string with email body.
attachmentsArrayArray of files to send. Element must be a full path or a IReference to a note, etc.
entityMobileCRM.ReferenceThe related entity reference.
relationshipMobileCRM.RelationshipThe relationship to the created email entity. (optional).
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.getDeviceInfo Function

Gets the device information.

Arguments

ArgumentTypeDescription
successfunction(result)A callback function for successful asynchronous result. The result will carry a MobileCRM._DeviceInfo object.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.getLocation Function

Gets current geo-location from platform-specific location service.

If the current platform does not support the location service, the failed handler is called with error "Unsupported".

Arguments

ArgumentTypeDescription
successfunction(result)A callback function for successful asynchronous result. The result will carry an object with properties latitude, longitude and timestamp .
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.
ageNumberMax age in seconds to accept GPS.
precisionNumberDesired accuracy in meters.
timeoutNumberTimeout in milliseconds (since v10.1).

MobileCRM.Platform.getLocationAsync Function

Gets current geo-location from platform-specific location service.

If the current platform does not support the location service, returned Promise is rejected with error "Unsupported".

Arguments

ArgumentTypeDescription
ageNumberMax age in seconds to accept GPS.
precisionNumberDesired accuracy in meters.
timeoutNumberTimeout in milliseconds (since v10.1).

Return value

Type: Promise<object>

A Promise object which will be resolved with an object having latitude and longitude properties.


MobileCRM.Platform.getNetworkInfo Function

[v11.2] Gets network information.

Arguments

ArgumentTypeDescription
successfunction(result)A callback function for successful asynchronous result. The result will carry an object with properties connected and fastConnection.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.getURL Function

Gets the full URL of currently loaded HTML document.

Arguments

ArgumentTypeDescription
successfunction(result)A callback function for successful asynchronous result. The result will carry a string with URL.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.makeCall Function

[v8.0] Opens the platform-specific call application with specified phone number.

Arguments

ArgumentTypeDescription
telephoneStringTelephone number
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.navigateTo Function

Execute the navigateTo function based on the latitude and longitude.

Arguments

ArgumentTypeDescription
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.openDocument Function

[v8.1] Opens specified document in associated program.

Apple security policy doesn&t allow this functionality on iOS.

Arguments

ArgumentTypeDescription
pathStringA path to the document file.
mimeTypeStringDocument MIME type (required on Android).
argsStringOptional arguments for Windows 7 command line.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.openUrl Function

Open url in external browser.

Arguments

ArgumentTypeDescription
urlStringweb page url

MobileCRM.Platform.preventBackButton Function

Prevents application to close when HW back button is pressed and installs handler which is called instead.

Pass "null" handler to allow the HW back button.

Works only under OS having HW back button (Android).

Arguments

ArgumentTypeDescription
handlerfunction()Handler function which will be called each time when user presses the Android HW back button.

MobileCRM.Platform.requestObject Function

Requests the managed Platform object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of Platform object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(platform)The callback function that is called asynchronously with serialized Platform object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Platform.scanBarCode Function

Activates the bar-code scanning.

If the current platform does not support the bar-code scanning, the failed handler is called with error "Unsupported".

Arguments

ArgumentTypeDescription
successfunction(result)A callback function for successful asynchronous result. The result will carry an array of strings with scanned codes.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.scanBarCodeRequiredLength Function

Activates the bar-code scanning.

If the current platform does not support the bar-code scanning, the failed handler is called with error "Unsupported".

Arguments

ArgumentTypeDescription
requiredLengthNumberSet required length of scanned barcode.
successfunction(result)A callback function for successful asynchronous result. The result will carry an array of strings with scanned codes.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Platform.sendEmail Function

[v15.0] Opens the platform-specific e-mail message form with pre-filled data.

Arguments

ArgumentTypeDescription
addressStringRecipient's email address.
subjectStringAn e-mail subject.
bodyStringA string with email body.
mimeTypeStringBody content MIME type.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.sendSMS Function

[v11.2.3] Opens the platform-specific sms application with specified phone number and pre-fill text.

Arguments

ArgumentTypeDescription
phoneNumberStringPhone number
textStringSMS text
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for errorCallback.

MobileCRM.Platform.showAlert Function

Shows a platform-specific alert window with specified text and buttons. Resolves to the pressed button name.

Arguments

ArgumentTypeDescription
textStringA message to show.
multiLineBooleanIf true, the message text will be displayed with larger height and the text will be wrapped.
defaultButtonStringThe default button caption. If not specified, there is no default button.
buttonsArrayAn array of button captions to display. If not specified, only default button or OK button is shown.

MobileCRM.Platform.showToast Function

Shows a platform-specific toast window over the app window which is dismissed after a few seconds.

Arguments

ArgumentTypeDescription
messageStringA toast content message.
iconStringValid app image name (e.g. Home.Now.png).

MobileCRM.Platform.watchLocationUpdates Function

[v18.2] Registers or unregisters a handler for location updates.

When the location is updated, the handler is called with a MobileCRM.Location object having latitude, longitude and timestamp properties.

Arguments

ArgumentTypeDescription
handlerfunction(location)Handler function which will be called each time when the location is updated. The location argument will carry an object with latitude, longitude and timestamp properties.
bindBooleanIndicates whether to bind or unbind handler.
scopeOptional scope for calling the handler; set "null" to call the handler in global scope.

Return value

Type: Promise<void>

A Promise object which will be resolved when the handler is successfully bound/unbound.


MobileCRM.Questionnaire Object

Provides a functionality for questionnaires.

Functions

FunctionDescription
getGroupNameGenerates the real name of repeatable question group.
getQuestionNameGenerates the real name of question from repeatable group.
showForm[v10.2] Shows the questionnaire form.

MobileCRM.Questionnaire.getGroupName Function

Generates the real name of repeatable question group.

Arguments

ArgumentTypeDescription
nameStringBase question group name from questionnaire template.
repeatIndexNumberRepeat index of the group.

MobileCRM.Questionnaire.getQuestionName Function

Generates the real name of question from repeatable group.

Arguments

ArgumentTypeDescription
nameStringBase question name from questionnaire template.
repeatIndexNumberRepeat index of the group containing the question.

MobileCRM.Questionnaire.showForm Function

[v10.2] Shows the questionnaire form.

This method is not available under Essential license.

Arguments

ArgumentTypeDescription
idStringId (guid) of the questionnaire.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.
relationshipMobileCRM.RelationshipOptional relationship with the parent record.
modalBooleanOptional parameter determines if the form will be opened in modal dialog. Defaults to false.
versionIntegerOptional parameter for setting the Questionnaire player version to execute the questionnaire. Default is 1

MobileCRM.Reference Object

Represents an entity reference which provides the minimum information about an entity.

Properties

PropertyTypeDescription
entityNameStringThe logical name of the reference, e.g. "account".
idStringGUID of the existing entity or null for new one.
isNewBooleanIndicates whether the entity is newly created.
primaryNameStringThe human readable name of the reference, e.g. "Alexandro".

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.Reference object.
toStringPrints the reference primary name into string.

Functions

FunctionDescription
loadAsyncAsynchronously loads the CRM reference.
loadByIdAsynchronously loads the CRM reference.

MobileCRM.Reference.constructor Method

Constructs an instance of MobileCRM.Reference object.

Arguments

ArgumentTypeDescription
entityNameStringThe logical name of the reference, e.g. "account".
idStringGUID of the existing entity or null for new one.
primaryNameStringThe human readable name of the reference, e.g "Alexandro".

MobileCRM.Reference.toString Method

Prints the reference primary name into string.

Return value

Type: String

A string with primary name of this entity reference.


MobileCRM.Reference.loadAsync Function

Asynchronously loads the CRM reference.

Arguments

ArgumentTypeDescription
entityNameStringAn entity name
idStringThe reference ID.

Return value

Type: Promise<MobileCRM.Reference>

A Promise object which will be resolved with an instance of Reference object representing entity record reference.


MobileCRM.Reference.loadById Function

Asynchronously loads the CRM reference.

Arguments

ArgumentTypeDescription
entityNameStringAn entity name
idStringThe reference ID.
successfunction(result)A callback function for successful asynchronous result. The result will carry an instance of MobileCRM.Reference object.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.Relationship Object

Represents a relationship between two entities.

Properties

PropertyTypeDescription
sourcePropertyStringGets the name of the source of the relationship.
targetMobileCRM.ReferenceGets the target of the relationship.
intersectEntityStringGets the intersect entity if any. Used when displaying entities that are associated through a Many to Many relationship.
intersectPropertyStringGets the intersect entity property if any. Used when displaying entities that are associated through a Many to Many relationship.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.Relationship object.

MobileCRM.Relationship.constructor Method

Constructs an instance of MobileCRM.Relationship object.

Arguments

ArgumentTypeDescription
sourcePropertyStringGets the name of the source of the relationship.
targetMobileCRM.ReferenceGets the target of the relationship.
intersectEntityStringGets the intersect entity if any. Used when displaying entities that are associated through a Many to Many relationship.
intersectPropertyStringGets the intersect entity property if any. Used when displaying entities that are associated through a Many to Many relationship.

MobileCRM._DeviceInfo Object

Represents the device information.

To obtain this object, use MobileCRM.Platform.getDeviceInfo function.

Properties

PropertyTypeDescription
nameStringGets the name identifying the device.
oSVersionStringGets name and version of operating system.
modelStringGets device model identifying the real device hardware.
buildInfoStringGets the build info (bundle ID on iOS)

MobileCRM._Settings Object

Internal object representing the application settings.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.Configuration.requestObject function. See MobileCRM.Configuration

Properties

PropertyTypeDescription
activeAppIDStringGets currently selected Application ID. & means default app. Null or empty string means that user hasn't chosen app yet.
afterSaveReloadNumberGets options for default after save behavior "None = 0, New = 1,Always = 2"
appIDsString[]Gets the list of Application IDs available for current user.
authenticationTypeNumberGets possible CRM server authentication methods. "AD = 0, PassPort = 1,SPLA = 2,PassportEMEA = 3,PassportAPAC = 4 "
businessUnitIdStringGets the current user's business unit id.
canUsePasswordBooleanGets whether there is a valid password and whether it can be used.
crm2011AuthIdStringGets the discovered CRM service authentication server identifier.
crm2011AuthTypeStringGets the discovered CRM service authentication server type.
crm2011AuthUrlStringGets the discovered CRM service authentication server url.
crmOnlineDeviceTokenStringGets the token (cookie) issued by LiveId services identifying this device.
crmOnlineDeviceTokenExpiresDateGets when CrmOnlineDeviceToken expires (UTC).
crmWebServiceMinorVersionNumberGets the discovered CRM service minor version (13 - for CRM 2011 Rollup 13 and up).
crmWebServiceVersionNumberGets the discovered CRM service version (4,5).
currencyDecimalPrecisionNumberGets or sets the organization Pricing Decimal Precision configuration option (0..4).
currencyDisplayOptionNumberGets or sets the currency field display option 0- Symbol ($), 1 - Code (USD).
currencyFormatCodeNumberGets or sets the currency field display option 0- $123, 1-123$, 2-$ 123, 3-123 $.
customerIdMobileCRM.ReferenceGets the customer when application is running in customer mode. MobileCRM.Reference object instance as argument
customerUserIdMobileCRM.ReferenceGets the CustomerUserId when application is running in customer mode. MobileCRM.Reference object instance as argument
dataverseCanUseTDSBooleanGets or sets whether Dataverse can use TDS (Tabular Data Stream) queries for downloads.
defaultFetchPageSizeNumberGets or sets the default fetch page size (#records downloaded in 1 request). Range 100-5000, default = 1000.
deviceFriendlyNameStringGets or sets the device friendly name e.g. "Steve's iPhone".
deviceIdentifierStringGets or sets the hardware unique id.
deviceInfoStringGets the device system and hardware information e.g. "Hewlett-Packard HP ProBook 6450b Microsoft Windows NT 6.1.7600.0"
disableSyncAnalyzerBooleanGets or sets whether the synchronization should use the SyncAnalyzer step.
discountCalculationMethodNumberGets or sets the option for calculating the discount 0 - apply after (Price*Quantity)-Discount , 1- apply before (Price-Discount)*Quantity.
distanceUnitsNumberIndicates whether to use metric system, imperial system or default device system (0=System default, 1=Metric, 2=Imperial).
downloadMultipleAttachmentsBooleanGets or sets whether to download multiple attachments in one batch request. Default false.
duplicateDetectionNumberGets whether duplicate detection is enabled and whether to detect against the local database, online, or always online. "Disabled = 0, Enabled = 1,AlwaysOnline = 2"
emailSignatureStringGets or sets the email signature.
enableAdvancedFindBooleanGets or sets whether to enable advanced find functionality. Default true.
enableListMultiSelectBooleanAllows user to multi-select in lists and calculate aggregates or execute custom commands.
enableListSearchButtonsBooleanGets or sets whether to allow list search buttons.
forceCustomizationDownloadBooleanGets or sets a value indicating whether the customization download is forced.
forcedFullSyncDateDateGets or sets the date when the device must be full synced. If the last sync was before this date, the next sync must be full.
forgetPasswordBooleanGets or sets whether password can be used for next login.
formCachePolicyNumberDetermines form caching policy (whether to cache no forms, default forms-only or also FormSelectRule forms (0=NoCaching, 1=DefaultFormCaching, 2=AllFormsCaching).
fullScreenFormsBooleanGets or sets whether to show forms maximized by default. Can be overridden per form in Woodford.
gPSAccuracyNumberGets or sets the default accuracy (in meters) when resolving the current position.
gPSMaxAgeNumberGets or sets the default maximum age (in seconds) of the last result when resolving the current position.
hasSyncErrorsBooleanIndicates whether there were any synchronization errors encountered.
homeLocationStringDefines the GPS location of the user's home. Must be in the form [latitude,longitude], e.g. 48.3,17.2
isOnlineCrmBooleanGets whether the last login was for a CRM Online instance.
languageStringGets the language of the application (e.g. en-US).
lastSyncDateDateGets the last synchronization end date.
logSyncDetailsBooleanGets or sets whether the synchronization log should include low level messages.
maxAttachmentSizeNumberGets or sets the maximum attachment size to sync (in bytes).
maxExecuteMultipleNumberGets or sets the maximum number of records to process in a single ExecuteMultiple request.
maxExecuteMultipleDataSizeNumberGets or sets the maximum size (in bytes) of records to upload in one request.
maxImageSizeNumberGets or sets the maximum size of the captured image. Bigger images are resized to this size (0=Default, 1=640x480, 2=1024x768, 3=1600x1200, 4=2048x1536, 5=2592x1936).
maxSyncCountNumberGets or sets the maximum number of records (per entity) to download.
maxUploadAttachmentSizeNumberGets or sets the maximum size (in bytes) of attachments created by app.
maxUploadImageSizeNumberGets or sets the maximum size of the uploaded image. Bigger images are resized to this size just after being captured/selected. (0=Default, 1=640x480, 2=1024x768, 3=1600x1200, 4=2048x1536, 5=2592x1936).
notifySyncFinishBooleanGets or sets whether to show a notification after sync finishes and app is not on foreground.
onlineNoLockBooleanGets or sets whether to use "no-lock" in fetchXml during online mode.
optimizeHiddenIframesBooleanIndicates whether to speed up hidden iFrames in Windows Store app by placing them into pre-loaded WebView container.
organizationIdStringGets the current user's organization id (given by the server).
organizationNameStringGets the current user's organization name (given by the server).
organizationUrlStringGets the current user's organization server URL.
pushIdStringGets platform-specific identifier for push notifications.
saveBehaviorNumberGets options for default after save behavior "Default = 0, SaveOnly = 1,SaveAndClose = 2"
saveSignatureAsImageBooleanGets or sets whether to store signature attachments as SVG (vector) or PNG (image).
serverHostNameStringGets the server host name.
serverSettingsVersionStringGets the version of the settings file as sent with the customization.
serverVersionNumberGets or sets the server version, either 4 for CRM 4.0 or 5 for CRM 2011.
showPersonalContactsBooleanGets or sets whether to show contacts from the user's personal address book.
showSystemCalendarsBooleanGets or sets whether to show private calendars in calendars.
systemUserEmailStringGets the current user email (given by the server).
systemUserIdStringGets the current user id (given by the server).
systemUserNameStringGets the current user name (given by the server).
teamsString[]Gets the array of ids of teams the current user is member of.
themeTypeNumberGets or sets app theme - system, light or dark. 0=Light, 1=Dark, 2=System
useCrmEmailBooleanGets or sets whether to create a CRM email entity or use the platform email service.
useDatabaseBlobStoreBooleanGets or sets whether to store attachment blobs in database or in files. If you change this setting you must perform a full sync!
useFlexiFormsBooleanGets or sets whether flexi forms (New UI) are enabled.
userDefaultCurrencyIdStringGets the user's default currency id. If not set use the organization default.
userNameStringGets the current user's name.
workLocationStringDefines the GPS location of the user's work. Must be in the form [latitude,longitude], e.g. 48.3,17.2

MobileCRM.FetchXml Namespace

Contains a set of objects implementing the FetchXML request methods

Objects

ObjectDescription
AttributeRepresents a FetchXml select statement (CRM field).
ConditionRepresents a FetchXml attribute condition statement.
EntityRepresents a FetchXml query root entity.
FetchRepresents a FetchXml query object.
FilterRepresents a FetchXml filter statement. A logical combination of Conditions and child-filters.
LinkEntityRepresents a FetchXml query linked entity.
OrderRepresents a FetchXml order statement.

MobileCRM.FetchXml.Attribute Object

Represents a FetchXml select statement (CRM field).

Properties

PropertyTypeDescription
aggregateStringAn aggregation function.
aliasStringDefines an attribute alias.
dategroupingStringA date group by modifier (year, quarter, month, week, day).
groupbyBooleanIndicates whether to group by this attribute.
nameStringA lower-case entity attribute name (CRM logical field name).

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.FetchXml.Attribute object.

MobileCRM.FetchXml.Attribute.constructor Method

Constructs an instance of MobileCRM.FetchXml.Attribute object.

Arguments

ArgumentTypeDescription
nameStringA lower-case entity attribute name (CRM logical field name).

MobileCRM.FetchXml.Condition Object

Represents a FetchXml attribute condition statement.

Properties

PropertyTypeDescription
attributeStringThe attribute name (CRM logical field name).
operatorStringThe condition operator. "eq", "ne", "in", "not-in", "between", "not-between", "lt", "le", "gt", "ge", "like", "not-like", "null", "not-null", "eq-userid", "eq-userteams", "today", "yesterday", "tomorrow", "this-year", "last-week", "last-x-hours", "next-x-years", "olderthan-x-months", ...
uinameStringThe lookup target entity display name.
uitypeStringThe lookup target entity logical name.
valueThe value to compare to.
valuesArrayThe list of values to compare to.

MobileCRM.FetchXml.Entity Object

Represents a FetchXml query root entity.

Properties

PropertyTypeDescription
allattributesBooleanIndicates whether to fetch all attributes instead of explicitly chosen set.
attributesArrayAn array of MobileCRM.FetchXml.Attribute objects.
filterMobileCRM.FetchXml.FilterA query filter.
linkentitiesArrayAn array of MobileCRM.FetchXml.LinkEntity objects.
nameStringAn entity logical name.
orderArrayAn array of MobileCRM.FetchXml.Order objects.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.FetchXml.Entity object.
addAttributeAdds an entity attribute to the fetch query.
addAttributesAdds all entity attributes to the fetch query.
addFilterAdds a filter for this fetch entity.
addLinkAdds an entity link (join) to the fetch query.
orderByAdds an order by statement to the fetch query.
removeLinkRemoves an entity link from the fetch query.

MobileCRM.FetchXml.Entity.constructor Method

Constructs an instance of MobileCRM.FetchXml.Entity object.

Arguments

ArgumentTypeDescription
nameStringAn entity logical name.

MobileCRM.FetchXml.Entity.addAttribute Method

Adds an entity attribute to the fetch query.

Arguments

ArgumentTypeDescription
nameStringThe attribute (CRM logical field name) to order by.
aliasStringOptional parameter defining an attribute alias.
aggregateStringOptional parameter defining an aggregation function.

Return value

Type: MobileCRM.FetchXml.Attribute

The newly created MobileCRM.FetchXml.Attribute object


MobileCRM.FetchXml.Entity.addAttributes Method

Adds all entity attributes to the fetch query.


MobileCRM.FetchXml.Entity.addFilter Method

Adds a filter for this fetch entity.

Return value

Type: MobileCRM.FetchXml.Filter

Existing or newly created entity filter.


MobileCRM.FetchXml.Entity.orderBy Method

Adds an order by statement to the fetch query.

Arguments

ArgumentTypeDescription
attributeStringThe attribute (CRM logical field name) to order by.
descendingBooleanfalse, for ascending order; true, for descending order.

Return value

Type: MobileCRM.FetchXml.Order

The newly created MobileCRM.FetchXml.Order object.


MobileCRM.FetchXml.Fetch Object

Represents a FetchXml query object.

Properties

PropertyTypeDescription
aggregateBooleanIndicates whether the fetch is aggregated.
countintthe maximum number of records to retrieve.
entityMobileCRM.FetchXml.EntityAn entity object.
pageint1-based index of the data page to retrieve.
distinctBooleanWhether to return only distinct (different) values.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.FetchXml.Fetch object.
executePerforms the asynchronous CRM Fetch request.
executeAsyncPerforms the asynchronous CRM Fetch request.
executeOffline[v8.0] Performs the offline CRM Fetch request regardless of the app online/offline mode.
executeOnline[v8.0] Performs the online CRM Fetch request regardless of the app online/offline mode.
serializeToXml[v10.0] Serializes the Fetch object to XML.
serializeToXmlAsync[v10.0] Serializes the Fetch object to XML.

Functions

FunctionDescription
deserializeFromXmlDeserializes the Fetch object from XML.
deserializeFromXmlAsyncDeserializes the Fetch object from XML.
executeFromXMLPerforms the asynchronous CRM Fetch command.
executeFromXmlAsyncExecutes fetch XML asynchronously.

MobileCRM.FetchXml.Fetch.constructor Method

Constructs an instance of MobileCRM.FetchXml.Fetch object.

Arguments

ArgumentTypeDescription
entityMobileCRM.FetchXml.EntityAn entity object.
countintthe maximum number of records to retrieve.
pageint1-based index of the data page to retrieve.
distinctboolWhether to return only distinct (different) values.
aggregateboolIndicates whether the fetch is aggregated.

MobileCRM.FetchXml.Fetch.execute Method

Performs the asynchronous CRM Fetch request.

Arguments

ArgumentTypeDescription
outputStringA string defining the output format: Array, JSON, XML or DynamicEntities.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the objects array of type specified by output argument.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.executeAsync Method

Performs the asynchronous CRM Fetch request.

Arguments

ArgumentTypeDescription
outputStringA string defining the output format: Array, JSON, XML or DynamicEntities.
onlineBooleanOptional parameter determining whether the fetch should be executed online or offline. If omitted, function respects current online/offline mode of the app.

Return value

Type: Promise<any[]>

A Promise object which will be resolved with array of objects having type specified by output argument.


MobileCRM.FetchXml.Fetch.executeOffline Method

[v8.0] Performs the offline CRM Fetch request regardless of the app online/offline mode.

Arguments

ArgumentTypeDescription
outputStringA string defining the output format: Array, JSON, XML or DynamicEntities.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the objects array of type specified by output argument.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.executeOnline Method

[v8.0] Performs the online CRM Fetch request regardless of the app online/offline mode.

Arguments

ArgumentTypeDescription
outputStringA string defining the output format: Array, JSON, XML or DynamicEntities.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the objects array of type specified by output argument.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.serializeToXml Method

[v10.0] Serializes the Fetch object to XML.

Arguments

ArgumentTypeDescription
successfunction(String)A callback function for successful asynchronous result. The result argument will carry the XML representation of the Fetch object.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.serializeToXmlAsync Method

[v10.0] Serializes the Fetch object to XML.

Return value

Type: Promise<string>

A Promise object which will be resolved with the XML representation of this Fetch object.


MobileCRM.FetchXml.Fetch.deserializeFromXml Function

Deserializes the Fetch object from XML.

Arguments

ArgumentTypeDescription
xmlStringA string defining the fetch XML request.
successfunction(result: MobileCRM.FetchXml.Fetch)A callback function for successful asynchronous result. The result argument will carry the Fetch object.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.deserializeFromXmlAsync Function

Deserializes the Fetch object from XML.

Arguments

ArgumentTypeDescription
xmlStringA string defining the fetch XML request.

Return value

Type: Promise<MobileCRM.FetchXml.Fetch>

A Promise object which will be resolved with the Fetch object.


MobileCRM.FetchXml.Fetch.executeFromXML Function

Performs the asynchronous CRM Fetch command.

Arguments

ArgumentTypeDescription
fetchXmlDataStringCRM fetch in XML representation.
successfunction(result)A callback function for successful asynchronous result. The result argument will carry the objects array of type specified by resultformat XML attribute (Array, JSON, XML or DynamicEntities).
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.

MobileCRM.FetchXml.Fetch.executeFromXmlAsync Function

Executes fetch XML asynchronously.

The format of result output is controlled by internal XML attribute "resultformat" on root fetch XML element.

Arguments

ArgumentTypeDescription
fetchXmlDataStringCRM fetch in XML representation.

Return value

Type: Promise

A promise object fulfilled with the array of objects having type specified by resultformat XML attribute (Array, JSON, XML or DynamicEntities).


MobileCRM.FetchXml.Filter Object

Represents a FetchXml filter statement. A logical combination of Conditions and child-filters.

Properties

PropertyTypeDescription
conditionsArrayAn array of Condition objects.
filtersArrayAn array of Filter objects representing child-filters.
typeStringDefines the filter operator ("or" / "and").

Methods

MethodDescription
betweenAdds a condition that the passed attribute is between the passed bounds.
containsAdds a condition that the passed column starts with the passed string.
isInAdds a attribute inclusion condition to the filter.
notInAdds a attribute inclusion condition to the filter.
startsWithAdds a condition that the passed column value contains the passed string.
whereAdds a attribute condition to the filter.

MobileCRM.FetchXml.Filter.between Method

Adds a condition that the passed attribute is between the passed bounds.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
lowDepends on attribute typeThe lower bound.
highDepends on attribute typeThe higher bound.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.Filter.contains Method

Adds a condition that the passed column starts with the passed string.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
valueStringThe value to compare to.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.Filter.isIn Method

Adds a attribute inclusion condition to the filter.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
valuesArrayAn array of values.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.Filter.notIn Method

Adds a attribute inclusion condition to the filter.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
valuesArrayAn array of values.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.Filter.startsWith Method

Adds a condition that the passed column value contains the passed string.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
valueStringThe value to compare to.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.Filter.where Method

Adds a attribute condition to the filter.

Arguments

ArgumentTypeDescription
attributeStringThe attribute name (CRM logical field name).
opStringThe condition operator. "eq", "ne", "lt", "le", "gt", "ge", "like"
valueDepends on attribute typeThe values to compare to.

Return value

Type: MobileCRM.FetchXml.Condition

The condition instance.


MobileCRM.FetchXml.LinkEntity Object

Represents a FetchXml query linked entity.

This object is derived from MobileCRM.FetchXml.Entity

Properties

PropertyTypeDescription
aliasStringA link alias.
fromStringThe "from" field (if parent then target entity primary key).
linktypeStringThe link (join) type ("inner" or "outer").
toStringThe "to" field.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.FetchXml.LinkEntity object.

MobileCRM.FetchXml.LinkEntity.constructor Method

Constructs an instance of MobileCRM.FetchXml.LinkEntity object.

Arguments

ArgumentTypeDescription
nameStringAn entity name

MobileCRM.FetchXml.Order Object

Represents a FetchXml order statement.

Properties

PropertyTypeDescription
aliasStringDefines an order alias.
attributeStringAn attribute name (CRM logical field name).
descendingBooleantrue, for descending order; false, for ascending order.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.FetchXml.Order object.

MobileCRM.FetchXml.Order.constructor Method

Constructs an instance of MobileCRM.FetchXml.Order object.

Arguments

ArgumentTypeDescription
attributeStringAn attribute name (CRM logical field name).
descendingBooleantrue, for descending order; false, for ascending order

MobileCRM.UI Namespace

Contains a set of objects implementing the Javascript equivalent of the MobileCRM application UI components.

These objects are not available under Essential license.

Objects

ObjectDescription
ChartDataSourceThe data source loading routine implementation.
EntityChart[13.0] Represents the Javascript equivalent of native entity chart object.
EntityFormRepresents the Javascript equivalent of native entity form object.
EntityList[v9.2] Represents the Javascript equivalent of native entity list object.
EntityListCellActionEnumeration class holding constants for MobileCRM.UI.EntityListClickEvent.
EntityListClickContextRepresents a context for the MobileCRM.UI.EntityList.onClick handler.
EntityListClickEventRepresents an event object for MobileCRM.UI.EntityListClickContext.
Form[v8.0] Represents the Javascript equivalent of the form object.
FormManagerA static object with functions allowing to open the entity forms.
HomeForm[v8.0] Represents the Javascript equivalent of the home form object which contains the Home/UI replacement iFrame.
IFrameForm[v9.0] Represents the iFrame form object.
ListDataSourceThe data source loading routine implementation.
LookupFormThis object allows user to select an entity from a configurable list of entity types.
MediaTabRepresents the MediaTab controller.
MessageBoxThis object allows the user to show a popup window and choose one of the actions.
MultiLookupForm[v9.3] This object allows user to select a list of entities from a configurable list of entity types. Derived from LookupForm so you can use the addView() and addEntityFilter() methods.
ProcessController[v8.2] Represents the Javascript equivalent of view process controller.
QuestionnaireForm[v10.3] Represents the Javascript equivalent of native questionnaire form object.
ReportForm[v8.1] Represents the Dynamics CRM report form object.
RoutePlan[v14.2] Represents the Javascript equivalent view of RoutePlan form object.
TourplanFormRepresents the Javascript equivalent tourplan form object.
TourplanViewModeEnumeration class holding constants for MobileCRM.UI.TourplanForm.
ViewControllerRepresents the Javascript equivalent of view controller (map/web content).
ViewDefinitionRepresents the entity view definition.
_AppointmentViewRepresents the Javascript equivalent view of tourplan form object.
_ControllerRepresents the Javascript equivalent of the view controller object.
_DetailItemRepresents the Javascript equivalent of detail item which is controlling the field editing.
_DetailViewRepresents the Javascript equivalent of detail view with set of items responsible for fields editing.
_DocumentControllerRepresents Media tab controller containing specific kind of document.
_DocumentInfoRepresents information about attached document.
_DocumentViewRepresents the document view object containing the attachment document (binary field content).
_EntityListRepresents the Javascript equivalent of the entity list controller object.
_ListViewRepresents the Javascript equivalent of the list view (control) object.
_ViewRepresents the Javascript equivalent of the view (control) object.

MobileCRM.UI.ChartDataSource Object

The data source loading routine implementation.

An instance of this object can be used to supply the data source for MobileCRM.UI.EntityChart.setDataSource function.

Properties

PropertyTypeDescription
typestringChart type in string
dataobjectObject of chart dataset

MobileCRM.UI.EntityChart Object

[13.0] Represents the Javascript equivalent of native entity chart object.

This object is not available under Essential license.

Functions

FunctionDescription
setDataSourceSets the chart data source replacement.

MobileCRM.UI.EntityChart.setDataSource Function

Sets the chart data source replacement.

Data source must be set during the document load stage and must not be delayed.

It is used only if the entity view iFrame is marked as data source provider in Woodford.

Arguments

ArgumentTypeDescription
dataSourceMobileCRM.UI.ChartDataSourceA data source object implementing the EntityChart loading routine.

MobileCRM.UI.EntityForm Object

Represents the Javascript equivalent of native entity form object.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.UI.EntityForm.requestObject function.
This object is not available under Essential license.

Properties

PropertyTypeDescription
associatedViewsArrayGets the associated views as an array of MobileCRM.UI._EntityList objects.
bulkUpdateItemsArrayA list of entity records editted on this bulk update form.
canEditBooleanGets whether the form can be edited.
canCloseBooleanDetermines if form can be closed, i.e. there are no unsaved data being edited.
contextObjectGets the specific context object for onChange and onSave handlers. The onChange context contains single property "changedItem" with the name of the changed detail item and the onSave context contains property "errorMessage" which can be used to break the save process with certain error message.
controllersArrayGets the form controllers (map, web) as an array of MobileCRM.UI._Controller objects.
detailViewsArrayGets the detailView controls as an array of MobileCRM.UI._DetailView objects.
isBulkUpdateFormBooleanIndicates whether the form is bulk update form.
entityMobileCRM.DynamicEntityGets or sets the entity instance the form is showing.
formMobileCRM.UI.FormGets the top level form.
iFrameOptionsObjectCarries the custom parameters that can be specified when opening the form using MobileCRM.UI.FormManager.
isDirtyBooleanIndicates whether the form has unsaved data.
relationshipMobileCRM.RelationshipDefines relationship with parent entity.
visibleBooleanGets whether the underlying form is visible.
documentViewMobileCRM.UI._DocumentViewNoteForm only. Gets the view containing the note attachment.

Methods

MethodDescription
cancelValidationStops the onSave validation and optionally causes an error message to be displayed.
getControllerReturns the tab controller by its view name.
getDetailViewReturns the DetailView by its name.
getEntityListReturns the entity list by its view name.
getMediaTabGets the MediaTab object representing the media tab with given name.
reactivateEntityReactivates inactive entity and reloads the form.
selectTab[v8.0] Selects the form tab by its name.
selectViewSelects the associated entity list view by its name.
setTabVisibilitySets the visibility of the form tab defined by its name.
suspendPostSave[v8.2] Suspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.
suspendSaveSuspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result
updateAddressFieldsSets the address fields according to the current geo-location from platform-specific location service.

Functions

FunctionDescription
closeWithoutSavingCloses the form ignoring all changes that have been made on it.
enableCommandEnables or disables the form command.
executeCommandByName[v8.1] Execute the command with the passed name. The command must exist and must be enabled.
isViewMaximized[v8.1] Inspects whether the passed view is maximized or restored.
leaveUiTransaction[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method releases the last clearance obtained by successful call to tryEnterUiTransaction. Can be called even if all clearances are already released or were not obtained at all. See tryEnterUiTransaction for more info.
loadTab[v10.1] (Re)loads the tab of the passed name.
maximizeView[v8.1] Makes the passed view maximized/restored.
onCanExecuteCommandBinds or unbinds the handler called when the EntityForm needs to find out whether the command can be executed (is enabled).
onChangeBinds or unbinds the handler for onChange event on EntityForm.
onCommandBinds or unbinds the handler for EntityForm command.
onItemChange[v11.2] Binds or unbinds the handler for specific item change event on EntityForm.
onPostSave[v8.2] Binds or unbinds the handler for onPostSave event on EntityForm.
onProcessLoadedBinds or unbinds the handler for onProcessLoaded event on EntityForm.
onSaveBinds or unbinds the handler for onSave event on EntityForm.
onSelectedViewChanged[v9.3] Binds or unbinds the handler for onSelectedViewChanged event on EntityForm.
openSalesEntityDetail[v8.2] Shows an entity edit dialog.
refreshFormReloads the form's edit state.
requestObjectRequests the managed EntityForm object.
save[v9.0]Saves the form entity and its children and refreshes the form.
saveAndCloseSaves edited entity and closes the form.
selectTabEx[v8.0] Selects the form tab by its name.
setFieldValue[v18.0] Sets the field value on entity record shown on this EntityForm.
setFieldValues[v18.0] Sets several field values on entity record loaded on this EntityForm.
setFileFieldContent[v18.2] Sets the file field content and file name on entity record shown on this EntityForm.
showPleaseWaitShows a please wait message, disabling the form except for the close command.
tryEnterUiTransaction[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method obtains a clearance to perform data manipulation. The clearance will be obtained when background sync is not running, or form sync behavior is configured as 'No action'. If background sync is running and form sync behavior is configured to 'Block save during sync' or 'Block save during sync and prevent sync while form is open'", the clearance is not obtained. Each obtained clearance must be dutifully released using leaveUiTransaction(). It is possible to call this method multiple times, but each call reserves its own internal clearance, so there must be the same number of calls to leaveUiTransaction to properly release clearance and allow background sync.

Objects

ObjectDescription
DetailCollectionProvides functions accessing the collection of the sales entity details (e.g. Order details)

MobileCRM.UI.EntityForm.cancelValidation Method

Stops the onSave validation and optionally causes an error message to be displayed.

Arguments

ArgumentTypeDescription
errorMsgStringAn error message to be displayed or "null" to cancel the validation without message.

MobileCRM.UI.EntityForm.getController Method

Returns the tab controller by its view name.

Arguments

ArgumentTypeDescription
nameStringA name of controller's view.

Return value

Type: MobileCRM.UI._Controller

A MobileCRM.UI._Controller object with requested view name.


MobileCRM.UI.EntityForm.getDetailView Method

Returns the DetailView by its name.

Arguments

ArgumentTypeDescription
nameStringA name of DetailView.

Return value

Type: MobileCRM.UI._DetailView

A MobileCRM.UI._DetailView object with requested name.


MobileCRM.UI.EntityForm.getEntityList Method

Returns the entity list by its view name.

Arguments

ArgumentTypeDescription
nameStringA name of entity list view.

Return value

Type: MobileCRM.UI._EntityList

A MobileCRM.UI._EntityList object with requested view name.


MobileCRM.UI.EntityForm.getMediaTab Method

Gets the MediaTab object representing the media tab with given name.

Return value

Type: MobileCRM.UI.MediaTab

A MobileCRM.UI.MediaTab object representing the media tab, or "null", if the tab was not found.


MobileCRM.UI.EntityForm.reactivateEntity Method

Reactivates inactive entity and reloads the form.

Arguments

ArgumentTypeDescription
statuscodeNumberActivation status code.

MobileCRM.UI.EntityForm.selectTab Method

[v8.0] Selects the form tab by its name.

Arguments

ArgumentTypeDescription
tabNameStringThe name of the tab.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityForm.selectView Method

Selects the associated entity list view by its name.

Arguments

ArgumentTypeDescription
tabNameStringThe name of the associated entity list tab.
viewNameStringThe view name.

Return value

Type: Boolean

true, if the view selection was initiated; false, if tab was not found.


MobileCRM.UI.EntityForm.setTabVisibility Method

Sets the visibility of the form tab defined by its name.

Arguments

ArgumentTypeDescription
tabNameStringThe name of the tab
visibleBooleanDefines desired visibility state.

Return value

Type: Boolean

true, if the visibility change was initiated; false, if tab was not found.


MobileCRM.UI.EntityForm.suspendPostSave Method

[v8.2] Suspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.

Return value

Type: Object

A request object with single method "resumePostSave" which has to be called to resume the post-save operations.


MobileCRM.UI.EntityForm.suspendSave Method

Suspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result

Return value

Type: Object

A request object with single method "resumeSave" which has to be called with the validation result (either error message string or "null" in case of success). To cancel the validation without any message, pass "#NoMessage#" text to this method.


MobileCRM.UI.EntityForm.updateAddressFields Method

Sets the address fields according to the current geo-location from platform-specific location service.

Arguments

ArgumentTypeDescription
latitudeNumberThe latitude from geo-location from platform-specific location service
longitudeNumberlongitude from geo-location from platform-specific location service

MobileCRM.UI.EntityForm.closeWithoutSaving Function

Closes the form ignoring all changes that have been made on it.


MobileCRM.UI.EntityForm.enableCommand Function

Enables or disables the form command.

Arguments

ArgumentTypeDescription
commandStringThe name of the command.
enableBooleanDetermines whether to enable or disable the command.
iParamNumber[v9.1] Optional parameter defining the additional command parameter (like status code value for "ChangeStatus" command).

MobileCRM.UI.EntityForm.executeCommandByName Function

[v8.1] Execute the command with the passed name. The command must exist and must be enabled.

Arguments

ArgumentTypeDescription
commandStringThe name of the EntityForm command.
callbackfunction(entityForm)The callback function that is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.isViewMaximized Function

[v8.1] Inspects whether the passed view is maximized or restored.

Arguments

ArgumentTypeDescription
viewNameStringThe name of the view which has to be maximized/restored.
callbackfunction(Boolean)Asynchronous callback which is called with Boolean result: true, if the view is maximized; false, if it is restored.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.leaveUiTransaction Function

[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method releases the last clearance obtained by successful call to tryEnterUiTransaction. Can be called even if all clearances are already released or were not obtained at all. See tryEnterUiTransaction for more info.

Return value

Type: Promise<void>

Returns an awaitable promise.


MobileCRM.UI.EntityForm.loadTab Function

[v10.1] (Re)loads the tab of the passed name.

Arguments

ArgumentTypeDescription
tabNameStringThe name of the tab.
loadBooleanWhether to (re)load or unload a view.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityForm.maximizeView Function

[v8.1] Makes the passed view maximized/restored.

Arguments

ArgumentTypeDescription
viewNameStringThe name of the view which has to be maximized/restored.
maximizeBooleantrue, to maximize the view; false, to restore it.

MobileCRM.UI.EntityForm.onCanExecuteCommand Function

Binds or unbinds the handler called when the EntityForm needs to find out whether the command can be executed (is enabled).

Arguments

ArgumentTypeDescription
commandStringThe name of the EntityForm command. Optionally can contain the param value separated by slash (e.g. ChangeStatus/5).
handlerfunction(entityForm)The handler function that has to be bound or unbound. Handler's return value indicates whether the command is enabled (true/false).
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onChange Function

Binds or unbinds the handler for onChange event on EntityForm.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onCommand Function

Binds or unbinds the handler for EntityForm command.

Arguments

ArgumentTypeDescription
commandStringThe name of the EntityForm command.
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onItemChange Function

[v11.2] Binds or unbinds the handler for specific item change event on EntityForm.

Arguments

ArgumentTypeDescription
itemNameStringThe name of desired detail item (mostly logical name of the field).
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onPostSave Function

[v8.2] Binds or unbinds the handler for onPostSave event on EntityForm.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onProcessLoaded Function

Binds or unbinds the handler for onProcessLoaded event on EntityForm.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onSave Function

Binds or unbinds the handler for onSave event on EntityForm.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.onSelectedViewChanged Function

[v9.3] Binds or unbinds the handler for onSelectedViewChanged event on EntityForm.

Bound handler is called with the EntityForm object as an argument. The EntityForm context object contains "selectedView" property with the name of currently selected view.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityForm.openSalesEntityDetail Function

[v8.2] Shows an entity edit dialog.

Arguments

ArgumentTypeDescription
detailMobileCRM.DynamicEntitydetail entity.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.

MobileCRM.UI.EntityForm.refreshForm Function

Reloads the form's edit state.


MobileCRM.UI.EntityForm.requestObject Function

Requests the managed EntityForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of EntityForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(entityForm)The callback function that is called asynchronously with serialized EntityForm object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.save Function

[v9.0]Saves the form entity and its children and refreshes the form.


MobileCRM.UI.EntityForm.saveAndClose Function

Saves edited entity and closes the form.


MobileCRM.UI.EntityForm.selectTabEx Function

[v8.0] Selects the form tab by its name.

Arguments

ArgumentTypeDescription
tabNameStringThe name of the tab.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityForm.setFieldValue Function

[v18.0] Sets the field value on entity record shown on this EntityForm.

Arguments

ArgumentTypeDescription
fieldNameStringLogical name of the field that has to be changed.
valueanyNew value of entity field with given name.

Return value

Type: Promise<boolean>

A promise resolved with boolean result of native field setter.


MobileCRM.UI.EntityForm.setFieldValues Function

[v18.0] Sets several field values on entity record loaded on this EntityForm.

Arguments

ArgumentTypeDescription
changes{ [fieldName: string]: any }An object defining field changes that has to be done on form entity record.

Return value

Type: Promise<boolean>

A promise resolved with boolean result of native field setter.


MobileCRM.UI.EntityForm.setFileFieldContent Function

[v18.2] Sets the file field content and file name on entity record shown on this EntityForm.

Setting file field content is possible only in offline mode. This method fails in online mode.

Arguments

ArgumentTypeDescription
fieldNameStringLogical name of the file field that has to be changed.
documentFileNameStringA file name that should be used when presenting the binary content.
documentContentStringBase64-encoded binary file content.

Return value

Type: Promise<boolean>

A promise resolved with boolean result of native field setter.


MobileCRM.UI.EntityForm.showPleaseWait Function

Shows a please wait message, disabling the form except for the close command.

Arguments

ArgumentTypeDescription
captionStringWait message.

Return value

Type: Object

An object representing the UI component with single method "close".


MobileCRM.UI.EntityForm.tryEnterUiTransaction Function

[v18.0] Provides means to control concurrent access to data by form logic and background sync. This method obtains a clearance to perform data manipulation. The clearance will be obtained when background sync is not running, or form sync behavior is configured as 'No action'. If background sync is running and form sync behavior is configured to 'Block save during sync' or 'Block save during sync and prevent sync while form is open'", the clearance is not obtained. Each obtained clearance must be dutifully released using leaveUiTransaction(). It is possible to call this method multiple times, but each call reserves its own internal clearance, so there must be the same number of calls to leaveUiTransaction to properly release clearance and allow background sync.

Return value

Type: Promise<boolean>

Returns true if clearance is obtained, false if it is not possible at this time.


MobileCRM.UI.EntityForm.DetailCollection Object

Provides functions accessing the collection of the sales entity details (e.g. Order details)

Functions

FunctionDescription
addAppends the product into sales order collection.
addAsync[v10.0] Appends the product into sales order collection.
addProductWithQuantity[v10.0] Appends the product into sales order collection.
deleteByIdDeletes the sales entity detail (e.g. Order detail) by id.
deleteByIndexDeletes the sales entity detail (e.g. Order detail) by index.
getAsynchronously returns requested sales entity detail (e.g. Order detail)
getAllAsynchronously returns the collection of the sales entity details (e.g. Order details)
getAllAsyncAsynchronously returns the collection of the sales entity details (e.g. Order details)
getAsyncAsynchronously returns requested sales entity detail (e.g. Order detail)
onChange[v8.2] Binds or unbinds the handler which is called when the list of sales details changes.

MobileCRM.UI.EntityForm.DetailCollection.add Function

Appends the product into sales order collection.

Resulting MobileCRM.DynamicEntity object implements method "update" which can be used to update the entity properties in the sales detail collection.

Arguments

ArgumentTypeDescription
productMobileCRM.ReferenceA reference of the product to be appended.
callbackfunction(MobileCRM.DynamicEntity)The callback function which is called asynchronously with MobileCRM.DynamicEntity object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.addAsync Function

[v10.0] Appends the product into sales order collection.

Resulting MobileCRM.DynamicEntity object implements method "update" which can be used to update the entity properties in the sales detail collection.

Arguments

ArgumentTypeDescription
productMobileCRM.ReferenceA reference of the product to be appended.
quantityNumberProduct quantity.

Return value

Type: Promise<MobileCRM.DynamicEntity>

A Promise object which will be resolved with the DynamicEntity object representing new sales entity detail record.


MobileCRM.UI.EntityForm.DetailCollection.addProductWithQuantity Function

[v10.0] Appends the product into sales order collection.

Resulting MobileCRM.DynamicEntity object implements method "update" which can be used to update the entity properties in the sales detail collection.

Arguments

ArgumentTypeDescription
productMobileCRM.ReferenceA reference of the product to be appended.
quantityNumberProduct quantity.
callbackfunction(MobileCRM.DynamicEntity)The callback function which is called asynchronously with MobileCRM.DynamicEntity object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.deleteById Function

Deletes the sales entity detail (e.g. Order detail) by id.

Arguments

ArgumentTypeDescription
idStringAn id of the item to be deleted.
callbackFunctionThe callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.deleteByIndex Function

Deletes the sales entity detail (e.g. Order detail) by index.

Arguments

ArgumentTypeDescription
indexNumberAn index of the item to be deleted.
callbackFunctionThe callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.get Function

Asynchronously returns requested sales entity detail (e.g. Order detail)

Arguments

ArgumentTypeDescription
indexNumberAn index of requested item.
callbackfunction(MobileCRM.DynamicEntity)The callback function that is called asynchronously with the MobileCRM.DynamicEntity object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.getAll Function

Asynchronously returns the collection of the sales entity details (e.g. Order details)

Arguments

ArgumentTypeDescription
callbackfunction(Array)The callback function that is called asynchronously with an array of MobileCRM.DynamicEntity objects as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityForm.DetailCollection.getAllAsync Function

Asynchronously returns the collection of the sales entity details (e.g. Order details)

Return value

Type: Promise<MobileCRM.DynamicEntity[]>

A Promise object which will be resolved with an array of DynamicEntity objects representing the sales entity detail records.


MobileCRM.UI.EntityForm.DetailCollection.getAsync Function

Asynchronously returns requested sales entity detail (e.g. Order detail)

Arguments

ArgumentTypeDescription
indexNumberAn index of requested item.

Return value

Type: Promise<MobileCRM.DynamicEntity>

A Promise object which will be resolved with the DynamicEntity object representing the sales entity detail record.


MobileCRM.UI.EntityForm.DetailCollection.onChange Function

[v8.2] Binds or unbinds the handler which is called when the list of sales details changes.

Arguments

ArgumentTypeDescription
handlerfunction(entityForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList Object

[v9.2] Represents the Javascript equivalent of native entity list object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
allowAddExistingBooleanGets or sets whether adding an existing entity is allowed.
allowCreateNewBooleanGets or sets whether create a new entity (or managing the N:N entities in the case of N:N list) is allowed.
allowedDocActionsNumberGets or sets a mask of document actions (for Note and Sharepoint document lists).
allowSearchBooleanGets or sets whether to show the search bar.
autoWideWidthStringGets the view auto width pixel size.
contextObject[v10.0] Gets the specific context object for onChange, onSave and onCommand handlers.

The onSave context contains property "entities" with the list of all changed entities and property "errorMessage" which can be used to cancel the save process with certain error message.

The onChange handler context contains "entities" property with the list of currently changed entities (typically just one entity) and property "propertyName" with the field name that was changed.

Command handler context contains the "cmdParam" property and "entities" property with the list of currently selected entities.

entityNameStringGets the name of the entities in this list.
flipModeNumberGets or sets the flip configuration (which views to show and which one is the initial).
hasMapViewsBooleanGets whether the list has a view that can be displayed on map.
hasCalendarViewsBooleanGets or sets whether there is a view with "CalendarFields".
hasMoreButtonBooleanGets whether the list needs a more button.
internalNameStringGets the internal list name. Used for localization and image lookup.
isDirtyBooleanGets or sets whether the list is dirty.
isLoadedBooleanGets or sets whether the list is loaded.
isMultiSelectBooleanGets whether multi selection is active.
listButtonsArrayGets the read-only array of strings defining the list buttons.
listModeNumberGets the current list mode.
listViewMobileCRM.UI._ListViewGets the controlled listView control.
lookupSourceMobileCRM.RelationshipGets the lookup source. If the list is used for lookup this is the entity whose property is being "looked-up".
optionsNumberGets the kinds of views available on the list.
relationshipMobileCRM.RelationshipGets the relation source and related entity. "null", if there is no relationship (if it is not an associated list).
selectedEntityMobileCRM.DynamicEntityGets currently selected entity. "null", if there's no selection.
uniqueNameNumberGets or sets the unique name of the list. Used to save/load list specific settings.

Methods

MethodDescription
suspendSave[v10.0] Suspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result

Functions

FunctionDescription
clickCell
onCellClick[v18.1] Binds or unbinds the handler for onCellClick event on EntityList.
onChange[v10.0] Binds or unbinds the handler for onChange event on EntityList.
onClick[v10.1] Binds or unbinds the handler for onClick event on EntityList.
onCommandBinds or unbinds the handler for EntityList command.
onSave[v10.0] Binds or unbinds the handler for onSave event on EntityList.
reloadInitiates asynchronous entity list reload.
requestEditedEntities[v10.0] Asynchronously gets the list of entities that were changed on the list.
requestObjectRequests the EntityList object.
runCommandExecutes the list/button command attached to this entity list.
selectViewSelects specified EntityList view.
setDataSourceDeprecated: Please use setDataSourceFactory instead. Sets the entity list data source replacement.
setDataSourceFactory[v11.0.2] Sets the entity list data source replacement factory.
setEntityProperty[v10.1] Sets the value of the entity property.
setPrimaryCommandOverrides the entity list's primary command button.
startEditCell

MobileCRM.UI.EntityList.suspendSave Method

[v10.0] Suspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result

Return value

Type: Object

A request object with single method "resumeSave" which has to be called with the validation result (either error message string or "null" in case of success). To cancel the validation without any message, pass "#NoMessage#" text to this method.


MobileCRM.UI.EntityList.clickCell Function

Opens an entity form for lookup content record. Performs appropriate action for cells bound to the phone/email/web formatted fields.

Arguments

ArgumentTypeDescription
rowIndexNumberThe index of the row to click on.
cellIndexNumberThe index of the cell.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityList.onCellClick Function

[v18.1] Binds or unbinds the handler for onCellClick event on EntityList.

Bound handler is called with the EntityList object as an argument. The EntityList context property contains EntityListClickContext object.

Arguments

ArgumentTypeDescription
propertyNameStringThe name of desired cell within the list item.
handlerfunction(entityList)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList.onChange Function

[v10.0] Binds or unbinds the handler for onChange event on EntityList.

Bound handler is called with the EntityList object as an argument. The EntityList context object contains "entities" property with the list of currently changed entities (typically just one entity) and property "propertyName" with the field name that was changed.

Arguments

ArgumentTypeDescription
handlerfunction(entityList)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList.onClick Function

[v10.1] Binds or unbinds the handler for onClick event on EntityList.

Bound handler is called with the EntityList object as an argument. The EntityList context property contains EntityListClickContext object.

Arguments

ArgumentTypeDescription
handlerfunction(entityList)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList.onCommand Function

Binds or unbinds the handler for EntityList command.

Bound handler is called with the EntityList object as an argument. The EntityList context object contains the "cmdParam" property and "entities" property with the list of currently selected entities.

Arguments

ArgumentTypeDescription
commandStringThe name of the EntityList command.
handlerfunction(entityList)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList.onSave Function

[v10.0] Binds or unbinds the handler for onSave event on EntityList.

Bound handler is called with the EntityList object as an argument. The EntityList context object contains "entities" property with the list of all changed entities and property "errorMessage" that can be used to cancel save with an error.

Arguments

ArgumentTypeDescription
handlerfunction(entityList)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.EntityList.reload Function

Initiates asynchronous entity list reload.


MobileCRM.UI.EntityList.requestEditedEntities Function

[v10.0] Asynchronously gets the list of entities that were changed on the list.

Arguments

ArgumentTypeDescription
callbackfunction(DynamicEntity[])Callback obtaining an array of dynamic entities that were changed on the list.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityList.requestObject Function

Requests the EntityList object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of EntityList object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(entityList)The callback function that is called asynchronously with serialized EntityList object as argument See MobileCRM.UI.EntityList for further details.. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.EntityList.runCommand Function

Executes the list/button command attached to this entity list.

Arguments

ArgumentTypeDescription
commandNameStringA name of the command. It can be either custom command or one of following predefined commands:
parameterNumberA command parameter (e.g. the status code value for ChangeStatus command).
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityList.selectView Function

Selects specified EntityList view.

Arguments

ArgumentTypeDescription
viewNameStringThe name of the entity view which has to be selected.

MobileCRM.UI.EntityList.setDataSource Function

Deprecated: Please use setDataSourceFactory instead. Sets the entity list data source replacement.

Data source must be set during the document load stage and must not be delayed.

It is used only if the entity view iFrame is marked as data source provider in Woodford.

Arguments

ArgumentTypeDescription
dataSourceMobileCRM.UI.ListDataSourceA data source object implementing the DynamicEntity list loading routine.

MobileCRM.UI.EntityList.setDataSourceFactory Function

[v11.0.2] Sets the entity list data source replacement factory.

Data source must be set during the document load stage and must not be delayed.

It is used only if the entity view iFrame is marked as data source provider in Woodford.

Arguments

ArgumentTypeDescription
dataSourceFactoryFunctionA function that returns an object implementing the DynamicEntity list loading routine.

MobileCRM.UI.EntityList.setEntityProperty Function

[v10.1] Sets the value of the entity property.

Arguments

ArgumentTypeDescription
rowIndexNumberThe index of the entity in the list.
propertyNameStringThe name of the property.
editValueanythe new property value.
saveImmediatelyBooleanIndicates whether to save entity immediately or whether to just make it dirty.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityList.setPrimaryCommand Function

Overrides the entity list's primary command button.

Arguments

ArgumentTypeDescription
labelsArray/StringAn array of labels or single label (e.g. "New").
callbackFunctionA callback which is called when command is launched.
scopeObjectA scope, in which the callback has to be called.

MobileCRM.UI.EntityList.startEditCell Function

Arguments

ArgumentTypeDescription
rowIndexNumberThe index of the row to edit.
cellIndexNumberThe index of the cell.
saveImmediatelyBooleanIndicates whether to save entity immediately after change or whether to just make it dirty.
bindingNumberOptional, if null the binding from the cell index will be used.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.EntityListCellAction Object

Enumeration class holding constants for MobileCRM.UI.EntityListClickEvent.

Properties

PropertyTypeDescription
TextNumberCell displaying data bound or constant text.
ImageNumber Cell displaying data bound or constant image.
ButtonNumber Clickable button cell.
InlineButtonNumber The inline button. iOS only.
EditableNumber The cell is editable. Or together with Text kind.
ClickableNumber The cell is clickable. Or together with Text kind.
DirectEditNumber The cell is editable and will be saved right after change. Or together with Text kind.
ActionMaskNumber The cell is editable or clickable.

MobileCRM.UI.EntityListClickContext Object

Represents a context for the MobileCRM.UI.EntityList.onClick handler.

Properties

PropertyTypeDescription
entitiesArraySingle item array containing the DynamicEntity object representing clicked entity.
propertyNameStringThe field name that was clicked within the list item.
eventMobileCRM.UI.EntityListClickEventEvent details.

MobileCRM.UI.EntityListClickEvent Object

Represents an event object for MobileCRM.UI.EntityListClickContext.

Properties

PropertyTypeDescription
cellNumberAn index of the cell in row template.
rowNumberThe row index.
bindingNumberA binding value.
actionNumberClick action flags. Use constant from MobileCRM.UI.EntityListCellAction enumeration.

MobileCRM.UI.Form Object

[v8.0] Represents the Javascript equivalent of the form object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
canMaximizeBooleanGets or sets whether form can be maximized to fullscreen (full application frame).
isMaximizedBooleanGets or sets whether form is currently maximized to fullscreen (full application frame).
isModalBooleanIndicates whether this form is presented as modal window.
captionStringGets or sets the form caption.
selectedViewIndexNumberGets or sets the selected view (tab) index.
showTitleBoolean[v8.1] Determines whether the form caption bar should be visible.
viewCountNumberGets the count of views in the form.
visibleBooleanGets whether the form is visible.

Functions

FunctionDescription
requestObject[v8.0] Requests the currently opened Form object.
showPleaseWaitShows a please wait message, disabling the form except for the close command.
showToastShows a toast window over the app window which is dismissed after a few seconds.

MobileCRM.UI.Form.requestObject Function

[v8.0] Requests the currently opened Form object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of Form object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(form)The callback function that is called asynchronously with serialized Form object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.Form.showPleaseWait Function

Shows a please wait message, disabling the form except for the close command.

Arguments

ArgumentTypeDescription
captionStringWait message.

Return value

Type: Object

An object representing the UI component with single method "close".


MobileCRM.UI.Form.showToast Function

Shows a toast window over the app window which is dismissed after a few seconds.

Arguments

ArgumentTypeDescription
messageStringA toast content message.
iconStringValid app image name (e.g. Home.Now.png).

MobileCRM.UI.FormManager Object

A static object with functions allowing to open the entity forms.

Functions

FunctionDescription
showDetailDialogShows an entity detail dialog.
showEditDialogShows an entity edit dialog.
showNewDialogShows a new entity dialog.

MobileCRM.UI.FormManager.showDetailDialog Function

Shows an entity detail dialog.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
idStringGUID of the existing entity.
relationshipMobileCRM.RelationShipThe optional relationship with a parent entity.

MobileCRM.UI.FormManager.showEditDialog Function

Shows an entity edit dialog.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
idStringGUID of the existing entity or null for new one.
relationshipMobileCRM.RelationShipThe optional relationship with a parent entity.
optionsObjectA JSON object containing a form-specific properties like pre-defined field values, peer iFrame options or document options.

MobileCRM.UI.FormManager.showNewDialog Function

Shows a new entity dialog.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
relationshipMobileCRM.RelationShipThe optional relationship with a parent entity.
optionsObjectA JSON object containing a form-specific properties like pre-defined field values, peer iFrame options or document options.

MobileCRM.UI.HomeForm Object

[v8.0] Represents the Javascript equivalent of the home form object which contains the Home/UI replacement iFrame.

This class works only from Home/UI replacement iFrame.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.UI.HomeForm.requestObject function.

This object is not available under Essential license.

Properties

PropertyTypeDescription
formMobileCRM.UI.FormGets the top level form.
itemsArrayGets the list of the home items.
listViewMobileCRM.UI._ListControllerGets the list view with home items.
lastSyncResultMobileCRM.Services.SynchronizationResult[v8.1] An object with last sync results. Contains following boolean properties: newCustomizationReady, customizationDownloaded, dataErrorsEncountered, appWasLocked, syncAborted, adminFullSync, wasBackgroundSync
syncResultTextString[v8.1] The last synchronization error text.
syncProgressObject[v8.1] An object with current sync progress. Contains following properties: labels, percent. It is undefined if no sync is running.

Functions

FunctionDescription
closeForms[v8.0] Close all opened forms.
closeHomeItemAsync[v8.0] Close the specified HomeItem.
hideUIReplacement[v8.0] Hides the UI replacement iframe and shows the classic home form.
onSyncFinished[v8.1] Binds the new handler to the synchronization finish event.
openHomeGroupItemAsync[v10.1.1] Opens the specified HomeItem in specific group.
openHomeItemAsync[v8.0] Opens the specified HomeItem.
requestObject[v8.0] Requests the managed HomeForm object.
restoreUIReplacement[v11.0] Restores previously hidden UI replacement iframe and hides the classic home form.
updateHomeItemAsync[v10.2] Updates specified HomeItem in specific group.
updateHomeItems[v10.3] Updates specified home items.

MobileCRM.UI.HomeForm.closeForms Function

[v8.0] Close all opened forms.

Arguments

ArgumentTypeDescription
callbackfunction()The callback function that is called asynchronously after forms were closed successfully.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.closeHomeItemAsync Function

[v8.0] Close the specified HomeItem.

Arguments

ArgumentTypeDescription
nameStringThe name of the HomeItem to be opened. It can be either the entity logical name (e.g. "contact"), custom name as defined in Woodford or one of following special names: "@Dashboard", "@Map", "@activity", "@Tourplan","@CallImport","@Setup","@About".
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.hideUIReplacement Function

[v8.0] Hides the UI replacement iframe and shows the classic home form.


MobileCRM.UI.HomeForm.onSyncFinished Function

[v8.1] Binds the new handler to the synchronization finish event.

Arguments

ArgumentTypeDescription
handlerfunction(homeForm)A function which will be called when the synchronization finished event occurs with current instance of the MobileCRM.UI.HomeForm as parameter.
scopeObjectA scope in which the handler should be called.

MobileCRM.UI.HomeForm.openHomeGroupItemAsync Function

[v10.1.1] Opens the specified HomeItem in specific group.

Arguments

ArgumentTypeDescription
itemsArrayA list of group and subgroups representing the path to the home item.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.openHomeItemAsync Function

[v8.0] Opens the specified HomeItem.

Arguments

ArgumentTypeDescription
nameStringThe name of the HomeItem to be opened. It can be either the entity logical name (e.g. "contact") or one of following special forms names: "@Dashboard", "@Map", "activity", "@Tourplan","@CallImport","@Setup","@About".
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.requestObject Function

[v8.0] Requests the managed HomeForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of HomeForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(homeForm)The callback function that is called asynchronously with serialized HomeForm object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.restoreUIReplacement Function

[v11.0] Restores previously hidden UI replacement iframe and hides the classic home form.


MobileCRM.UI.HomeForm.updateHomeItemAsync Function

[v10.2] Updates specified HomeItem in specific group.

Arguments

ArgumentTypeDescription
itemsArrayA list of group and subgroups representing the path to the home item.
titleStringThe title for the home item.
subTitleStringThe title for the home item.
badgeStringThe title for the home item.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.HomeForm.updateHomeItems Function

[v10.3] Updates specified home items.

Arguments

ArgumentTypeDescription
itemsArrayA list of home item that has to be changed. Each home item is an object with following properties: path, title, subTitle, badge, isVisible.

MobileCRM.UI.IFrameForm Object

[v9.0] Represents the iFrame form object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
formMobileCRM.UI.FormGets the form hosting the iFrame.
isDirtyBoolean[v10.0] Controls whether the form is dirty and requires save, or whether it can be closed.
optionsObjectCarries the custom parameters that can be specified when opening the form using MobileCRM.UI.IFrameForm.show function.
preventCloseMessageString[v9.3] Prevents closing the form if non-empty string is set. No other home-item can be opened and synchronization is not allowed to be started. Provided message is shown when user tries to perform those actions.
saveBehaviorNumber[v10.0] Controls the behavior of the Save command on this form (0=Default, 1=SaveOnly, 2=SaveAndClose).

Methods

MethodDescription
suspendSave[v10.0] Suspends current "onSave" process and allows performing asynchronous tasks to save the data.

Functions

FunctionDescription
onSave[v10.0] Binds or unbinds the handler for saving content of this iFrame.
preventClose[v10.0] Sets the warning message that should be shown when user tries to close the form.
requestObject[v9.0] Asynchronously requests the IFrameForm object.
setDirty[v10.0] Sets the dirty flag which prevents the form being closed. App asks to save the form before saving and if user chooses to save it, it calls the save routine defined in IFrameForm.saveCommand.
showShows a new iFrame form.
showModalShows a new iFrame form in modal window.

MobileCRM.UI.IFrameForm.suspendSave Method

[v10.0] Suspends current "onSave" process and allows performing asynchronous tasks to save the data.

Return value

Type: Object

A request object with single method "resumeSave" which has to be called with the result (either error message string or "null" in case of success). To cancel the validation without any message, pass "#NoMessage#" text to this method.


MobileCRM.UI.IFrameForm.onSave Function

[v10.0] Binds or unbinds the handler for saving content of this iFrame.

Bound handler is called with the IFrameForm object as an argument.

The IFrameForm context object contains property "errorMessage" that can be used to cancel save with an error.

Use suspendSave method to suspend the save process if an asynchronous operation is required.

Arguments

ArgumentTypeDescription
handlerfunction(IFrameForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.IFrameForm.preventClose Function

[v10.0] Sets the warning message that should be shown when user tries to close the form.

Set to "null" to allow the form close.


MobileCRM.UI.IFrameForm.requestObject Function

[v9.0] Asynchronously requests the IFrameForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of IFrameForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(iFrameForm)The callback function that is called asynchronously with serialized MobileCRM.UI.IFrameForm object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.IFrameForm.setDirty Function

[v10.0] Sets the dirty flag which prevents the form being closed. App asks to save the form before saving and if user chooses to save it, it calls the save routine defined in IFrameForm.saveCommand.


MobileCRM.UI.IFrameForm.show Function

Shows a new iFrame form.

Arguments

ArgumentTypeDescription
captionStringDefines the form caption.
urlStringDefines the URL of the HTML document.
maximizedBooleanIndicates whether the new form should be maximized.
optionsObjectGeneric object passed to the new iFrame (see MobileCRM.UI.IFrameForm.requestObject).

MobileCRM.UI.IFrameForm.showModal Function

Shows a new iFrame form in modal window.

Arguments

ArgumentTypeDescription
captionStringDefines the form caption.
urlStringDefines the URL of the HTML document.
optionsObjectGeneric object passed to the new iFrame.

MobileCRM.UI.ListDataSource Object

The data source loading routine implementation.

An instance of this object can be used to supply the data source for MobileCRM.UI.EntityList.setDataSourceFactory function.

The instance of this object is valid only if the method loadNextChunk is implemented. See example here.

Properties

PropertyTypeDescription
chunkSizeNumberControls the number of entities loaded in once.
fetchMobileCRM.FetchXml.FetchGets the original fetch request for this list view.
loadNextChunkfunction(page, count)Controls the number of entities loaded in once. It is called from native code to get chunk (array) of DynamicEntities. The chunk is defined by 1-based page number and the desired count which corresponds to the value of chunkSize property.

Methods

MethodDescription
chunkReadyThis method has to be called from within the "loadNextChunk" routine when it loads chunk (array) of DynamicEntities.

MobileCRM.UI.ListDataSource.chunkReady Method

This method has to be called from within the "loadNextChunk" routine when it loads chunk (array) of DynamicEntities.

Data source enumeration ends when the chunkReady method is called with empty array (no more records are available).

Arguments

ArgumentTypeDescription
entitiesArray[MobileCRM.DynamicEntity]A chunk (array) of DynamicEntities that has to be passed back to the native code to fill in to the list view.

MobileCRM.UI.LookupForm Object

This object allows user to select an entity from a configurable list of entity types.

This object is not available under Essential license.

Properties

PropertyTypeDescription
entitiesArrayAn array of allowed entity kinds (schema names).
allowedViewsStringOBSOLETE: Allowed views, or null if all are allowed.
sourceMobileCRM.RelationshipThe entity whose property will be set to the chosen value.
prevSelectionMobileCRM.ReferenceThe entity whose property will be set to the chosen value.
allowNullBooleanWhether to allow selecting no entity.
preventCloseBooleanWhether to prevent closing form without choosing a value.

Methods

MethodDescription
addEntityFilterDefines a fetch XML filter for entity records.
addViewAppends an entity view to the list of allowed views.
showShows a dialog which allows the user to select an entity from a configurable list of entity types.
showAsyncShows a dialog which allows the user to select an entity from a configurable list of entity types.

MobileCRM.UI.LookupForm.addEntityFilter Method

Defines a fetch XML filter for entity records.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
filterXmlstringA string defining the fetch XML which has to be applied as filter for entity records.

MobileCRM.UI.LookupForm.addView Method

Appends an entity view to the list of allowed views.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
viewNamestringA name of the view.
isDefaultBooleantrue, if the view should be set as default.

MobileCRM.UI.LookupForm.show Method

Shows a dialog which allows the user to select an entity from a configurable list of entity types.

Arguments

ArgumentTypeDescription
successfunction(obj)The callback function that is called with chosen MobileCRM.Reference object.
failedfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.LookupForm.showAsync Method

Shows a dialog which allows the user to select an entity from a configurable list of entity types.

Return value

Type: Promise<MobileCRM.Reference>

A Promise object which will be resolved with a Reference object representing chosen entity record.


MobileCRM.UI.MediaTab Object

Represents the MediaTab controller.

An instance of this class can only be obtained by calling the MobileCRM.UI.EntityForm.getMediaTab method.

Methods

MethodDescription
capturePhotoCaptures photo on this media tab.
clearClears the content of this media tab.
exportSaves to file to disk.
getData[v8.0] Gets the media tab document in form of base64 string.
getDataAsync[v8.0] Gets the media tab document in form of base64 string.
getDocumentInfo[v8.0.1] Asynchronously gets the media tab view object.
getNoteSubject[v10.1] Asynchronously gets the subject text of the note loaded on the media tab.
isEmpty[v9.0.2] Asynchronously gets the boolean value indicating whether the media tab content is empty or not.
openOpens the loaded document in a external application. Which application is platform specific.
printPrints the document.
recordAudioExecutes the record audio command on this media tab.
recordVideoExecutes the record video command on this media tab.
selectFileExecutes the select file command on this media tab.
selectPhotoExecutes the select photo command on this media tab.
setCommandsMask[v11.1] Sets the mask of allowed document actions.
setEditable[v11.1] Marks the MediaTab as editable.
setNoteSubject[v10.1] Asynchronously sets the name of the note to load (and save).

Functions

FunctionDescription
getData[v8.0] Gets the media tab document in form of base64 string.
getDataAsync[v8.0] Gets the media tab document in form of base64 string.

MobileCRM.UI.MediaTab.capturePhoto Method

Captures photo on this media tab.


MobileCRM.UI.MediaTab.clear Method

Clears the content of this media tab.


MobileCRM.UI.MediaTab.export Method

Saves to file to disk.


MobileCRM.UI.MediaTab.getData Method

[v8.0] Gets the media tab document in form of base64 string.

Arguments

ArgumentTypeDescription
callbackfunction(String)The callback function that is called asynchronously with the base64-encoded document data.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.getDataAsync Method

[v8.0] Gets the media tab document in form of base64 string.

Return value

Type: Promise<string>

A Promise object which will be resolved with the base64-encoded document data.


MobileCRM.UI.MediaTab.getDocumentInfo Method

[v8.0.1] Asynchronously gets the media tab view object.

Arguments

ArgumentTypeDescription
callbackfunction(Object)The callback function that is called asynchronously with the document info object.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.getNoteSubject Method

[v10.1] Asynchronously gets the subject text of the note loaded on the media tab.

Arguments

ArgumentTypeDescription
callbackfunction(String)The callback function that is called asynchronously with the media tab note subject.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.isEmpty Method

[v9.0.2] Asynchronously gets the boolean value indicating whether the media tab content is empty or not.

Arguments

ArgumentTypeDescription
callbackfunction(Boolean)The callback function that is called asynchronously with the boolean value indicating whether the content is empty or not.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.open Method

Opens the loaded document in a external application. Which application is platform specific.


MobileCRM.UI.MediaTab.print Method

Prints the document.


MobileCRM.UI.MediaTab.recordAudio Method

Executes the record audio command on this media tab.


MobileCRM.UI.MediaTab.recordVideo Method

Executes the record video command on this media tab.


MobileCRM.UI.MediaTab.selectFile Method

Executes the select file command on this media tab.


MobileCRM.UI.MediaTab.selectPhoto Method

Executes the select photo command on this media tab.


MobileCRM.UI.MediaTab.setCommandsMask Method

[v11.1] Sets the mask of allowed document actions.

Arguments

ArgumentTypeDescription
commandMaskNumberSpecifies the mask of allowed commands.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.

MobileCRM.UI.MediaTab.setEditable Method

[v11.1] Marks the MediaTab as editable.

Arguments

ArgumentTypeDescription
editableBooleanIndicates whether to mark MediaTab as editable.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.

MobileCRM.UI.MediaTab.setNoteSubject Method

[v10.1] Asynchronously sets the name of the note to load (and save).

Arguments

ArgumentTypeDescription
subjectStringThe name of the note to load (and save).
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.getData Function

[v8.0] Gets the media tab document in form of base64 string.

Arguments

ArgumentTypeDescription
viewNameStringThe name of the media tab.
callbackfunction(String)The callback function that is called asynchronously with the base64-encoded document data.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MediaTab.getDataAsync Function

[v8.0] Gets the media tab document in form of base64 string.

Arguments

ArgumentTypeDescription
viewNameStringThe name of the media tab.

Return value

Type: Promise<string>

A Promise object which will be resolved with the base64-encoded document data.


MobileCRM.UI.MessageBox Object

This object allows the user to show a popup window and choose one of the actions.

Properties

PropertyTypeDescription
itemsArrayAn array of button names.
titlestringThe message box title.
defaultTextstringThe cancel button title text.
multiLineBooleanIndicates whether the message is multi line.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.MessageBox object.
showShows a popup window which allows the user to choose one of the actions.
showAsyncShows a popup window allowing user to choose one of actions.

Functions

FunctionDescription
sayTextShows a simple popup window with a multi-line text.
sayTextAsyncShows a simple popup window with a multi-line text.

MobileCRM.UI.MessageBox.constructor Method

Constructs an instance of MobileCRM.UI.MessageBox object.

Arguments

ArgumentTypeDescription
titlestringThe message box title.
defaultTextstringThe cancel button title text.

MobileCRM.UI.MessageBox.show Method

Shows a popup window which allows the user to choose one of the actions.

Arguments

ArgumentTypeDescription
successfunction(obj)The callback function that is called with chosen item string.
failedfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MessageBox.showAsync Method

Shows a popup window allowing user to choose one of actions.

Return value

Type: Promise<string>

A Promise object which will be resolved with chosen item string.


MobileCRM.UI.MessageBox.sayText Function

Shows a simple popup window with a multi-line text.

Arguments

ArgumentTypeDescription
textStringA text to be shown.
successfunctionThe callback function that is called after user closes the message box.
failedfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MessageBox.sayTextAsync Function

Shows a simple popup window with a multi-line text.

Arguments

ArgumentTypeDescription
textStringA text to be shown.

Return value

Type: Promise<void>

A Promise object which will be resolved when user closes the message box.


MobileCRM.UI.MultiLookupForm Object

[v9.3] This object allows user to select a list of entities from a configurable list of entity types. Derived from LookupForm so you can use the addView() and addEntityFilter() methods.

This object is not available under Essential license.

Properties

PropertyTypeDescription
entitiesArrayAn array of allowed entity kinds (schema names).
sourceMobileCRM.RelationshipThe entity whose property will be set to the chosen value.
dataSourceMobileCRM.Reference[]The list of entities that should be displayed as selected.
allowNullBooleanWhether to allow selecting no entity.
initialTabNumberOptional index of the tab which has to be pre-selected - 0=All Items, 1=Selected Items (default).

Methods

MethodDescription
addEntityFilterDefines a fetch XML filter for entity records.
addViewAppends an entity view to the list of allowed views.
showShows a dialog which allows the user to select a list of entities from a configurable list of entity types.
showAsyncShows a dialog which allows the user to select a list of entities from a configurable list of entity types.

MobileCRM.UI.MultiLookupForm.addEntityFilter Method

Defines a fetch XML filter for entity records.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
filterXmlstringA string defining the fetch XML which has to be applied as filter for entity records.

MobileCRM.UI.MultiLookupForm.addView Method

Appends an entity view to the list of allowed views.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
viewNamestringA name of the view.
isDefaultBooleantrue, if the view should be set as default.

MobileCRM.UI.MultiLookupForm.show Method

Shows a dialog which allows the user to select a list of entities from a configurable list of entity types.

Arguments

ArgumentTypeDescription
successfunction(obj)The callback function that is called with chosen array of MobileCRM.Reference objects.
failedfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.MultiLookupForm.showAsync Method

Shows a dialog which allows the user to select a list of entities from a configurable list of entity types.

Return value

Type: Promise<MobileCRM.Reference[]>

A Promise object which will be resolved with an array of Reference objects representing chosen entity records.


MobileCRM.UI.ProcessController Object

[v8.2] Represents the Javascript equivalent of view process controller.

It is not intended to create an instance of this class. To obtain this object, use EntityForm.requestObject function and locate the controller in form's "controllers" list.

This object is not available under Essential license.

Properties

PropertyTypeDescription
currentStateInfoObjectGets the information about the current process flow state (active stage, visible stage and process).

Methods

MethodDescription
changeProcess[v8.2] Changes (or clears) the business process flow for the current entity.
moveToNextStage[15.0] Progresses to the next stage of the active process.
moveToPreviousStage[15.0] Moves to the previous stage of the active process.

MobileCRM.UI.ProcessController.changeProcess Method

[v8.2] Changes (or clears) the business process flow for the current entity.

Arguments

ArgumentTypeDescription
processRefMobileCRM.ReferenceA reference to the workflow entity defining the process to use, or null to disable BusinessProcessFlow.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.ProcessController.moveToNextStage Method

[15.0] Progresses to the next stage of the active process.

Arguments

ArgumentTypeDescription
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.ProcessController.moveToPreviousStage Method

[15.0] Moves to the previous stage of the active process.

Arguments

ArgumentTypeDescription
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callback.

MobileCRM.UI.QuestionnaireForm Object

[v10.3] Represents the Javascript equivalent of native questionnaire form object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
formMobileCRM.UI.FormGets the form which hosts the questionnaire.
groupsMobileCRM.UI.QuestionnaireForm.Group[]A list of QuestionnaireForm.Group objects.
questionsMobileCRM.UI.QuestionnaireForm.Question[]A list of QuestionnaireForm.Question objects.
relationshipMobileCRM.RelationshipGets the relation source and related entity. "null", if there is no relationship.

Methods

MethodDescription
cancelValidationStops the onSave validation and optionally causes an error message to be displayed.
findGroupByIdReturns the question group with given id.
findGroupByNameReturns the question group with given name.
findQuestionByIdReturns the question item with given id.
findQuestionByNameReturns the question item with given name.
suspendPostSaveSuspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.
suspendSaveSuspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result

Functions

FunctionDescription
changeLookupQuestionSetupSets the views and filters for specified lookup question.
deleteGroupDeletes an instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.
executeQuestionAction[v19.1] Asynchronously focuses the question and executes its operations, e.g. Scan Barcode, Run OCR, etc...
focusQuestionAsynchronously sets the focus on given question.
getQuestionnaireEntityRequests the Questionnaire entity.
onAnswerChanged[v11.2] Binds or unbinds the handler for specific question change event on QuestionnaireForm.
onChangeBinds or unbinds the handler for onChange event on QuestionnaireForm.
onCommandBinds or unbinds the handler for QuestionnaireForm command.
onDeleteGroupBinds or unbinds the handler for onDeleteGroup event on QuestionnaireForm.
onPostSaveBinds or unbinds the handler for onPostSave event on QuestionnaireForm.
onRepeatGroupBinds or unbinds the handler for onRepeatGroup event on QuestionnaireForm.
onSaveBinds or unbinds the handler for onSave event on QuestionnaireForm.
overridePicklistOptionsOverrides the list of options for given picklist question.
repeatGroupDuplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
repeatGroupAsyncDuplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
requestObjectRequests the managed QuestionnaireForm object.
trySetAnswerAsynchronously sets the answer value for given question.
trySetImageAnswerAsynchronously sets the answer value for given image question.

Objects

ObjectDescription
Group
Question

MobileCRM.UI.QuestionnaireForm.cancelValidation Method

Stops the onSave validation and optionally causes an error message to be displayed.

Arguments

ArgumentTypeDescription
errorMsgStringAn error message to be displayed or "null" to cancel the validation without message.

MobileCRM.UI.QuestionnaireForm.findGroupById Method

Returns the question group with given id.

Arguments

ArgumentTypeDescription
nameStringAn id of the question group.

Return value

Type: MobileCRM.UI.QuestionnaireForm.Group


MobileCRM.UI.QuestionnaireForm.findGroupByName Method

Returns the question group with given name.

Arguments

ArgumentTypeDescription
nameStringA name of the question group.

Return value

Type: MobileCRM.UI.QuestionnaireForm.Group


MobileCRM.UI.QuestionnaireForm.findQuestionById Method

Returns the question item with given id.

Arguments

ArgumentTypeDescription
idStringAn id of the question item.

Return value

Type: MobileCRM.UI.QuestionnaireForm.Question


MobileCRM.UI.QuestionnaireForm.findQuestionByName Method

Returns the question item with given name.

Arguments

ArgumentTypeDescription
nameStringA name of the question item.

Return value

Type: MobileCRM.UI.QuestionnaireForm.Question


MobileCRM.UI.QuestionnaireForm.suspendPostSave Method

Suspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.

Return value

Type: Object

A request object with single method "resumePostSave" which has to be called to resume the post-save operations.


MobileCRM.UI.QuestionnaireForm.suspendSave Method

Suspends current "onSave" validation and allows performing another asynchronous tasks to determine the validation result

Return value

Type: Object

A request object with single method "resumeSave" which has to be called with the validation result (either error message string or "null" in case of success). To cancel the validation without any message, pass "#NoMessage#" text to this method.


MobileCRM.UI.QuestionnaireForm.changeLookupQuestionSetup Function

Sets the views and filters for specified lookup question.

Arguments

ArgumentTypeDescription
questionNameStringA name of the question.
dialogSetupMobileCRM.UI.DetailViewItems.LookupSetupLookup setup for modal lookup dialog.
inlinePickSetupMobileCRM.UI.DetailViewItems.LookupSetupOptional setup for inline lookup picker. Leave empty to use the same setup as modal dialog.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.deleteGroup Function

Deletes an instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.

Arguments

ArgumentTypeDescription
idStringId of the source group.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.executeQuestionAction Function

[v19.1] Asynchronously focuses the question and executes its operations, e.g. Scan Barcode, Run OCR, etc...

Arguments

ArgumentTypeDescription
questionNameStringA name of the question.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.focusQuestion Function

Asynchronously sets the focus on given question.

Arguments

ArgumentTypeDescription
questionNameStringA name of the question.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.getQuestionnaireEntity Function

Requests the Questionnaire entity.

Arguments

ArgumentTypeDescription
callbackfunction(entity)The callback function that is called asynchronously with a DynamicEntity object representing currently opened questionnaire. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.onAnswerChanged Function

[v11.2] Binds or unbinds the handler for specific question change event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
questionNameStringThe name of desired question.
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onChange Function

Binds or unbinds the handler for onChange event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onCommand Function

Binds or unbinds the handler for QuestionnaireForm command.

Arguments

ArgumentTypeDescription
commandStringThe name of the QuestionnaireForm command.
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onDeleteGroup Function

Binds or unbinds the handler for onDeleteGroup event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onPostSave Function

Binds or unbinds the handler for onPostSave event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onRepeatGroup Function

Binds or unbinds the handler for onRepeatGroup event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.onSave Function

Binds or unbinds the handler for onSave event on QuestionnaireForm.

Arguments

ArgumentTypeDescription
handlerfunction(questionnaireForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.QuestionnaireForm.overridePicklistOptions Function

Overrides the list of options for given picklist question.

Arguments

ArgumentTypeDescription
questionNameStringA name of the picklist question.
allowNullBooleanIndicates whether the empty answer is allowed.
optionsObjectAn object with label-to-value mappings, e.g. {"Option 1":1,"Option 2":2}.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.repeatGroup Function

Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.

Arguments

ArgumentTypeDescription
idStringId of the source group.
copyValuesBooleanOptional paramater determining whether the group values should be copied to the new instance of this group.

Return value

Type: Promise

A promise that resolves when the group is duplicated.


MobileCRM.UI.QuestionnaireForm.repeatGroupAsync Function

Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.

Arguments

ArgumentTypeDescription
idStringId of the source group.
copyValuesBooleanOptional paramater determining whether the group values should be copied to the new instance of this group.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.requestObject Function

Requests the managed QuestionnaireForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of QuestionnaireForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(questionnaireForm)The callback function that is called asynchronously with serialized QuestionnaireForm object as argument. Callback should return true to apply changed properties.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.trySetAnswer Function

Asynchronously sets the answer value for given question.

Arguments

ArgumentTypeDescription
questionNameStringA name of the question.
answeranyA value that has to be set as answer. It must correspond to the type of question.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.trySetImageAnswer Function

Asynchronously sets the answer value for given image question.

Arguments

ArgumentTypeDescription
imageQuestionNameStringA name of the image question.
base64DatastringA value that us used to create image answer. If null or empty image will be deleted.
mimeTypestringThe valid mime type of corresponding base64Data.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.Group Object

Properties

PropertyTypeDescription
idStringGets the id of this question group.
nameStringGets the name of the question group.
indexNumberGets the index of the question group.
labelStringGets the question group label.
descriptionStringGet the question group description.
templateGroupStringGets the id of parent group from questionnaire template.
repeatIndexNumberIndex of this instance of repeatable group. Zero for non-repeatable groups.
repeatEnabledBooleanIndicates whether the group is repeatable.
isVisibleBooleanGets or sets whether the group is visible.
isEnabledBooleanGets or sets whether the group is enabled.
isExpandedBooleanGets or sets whether the group is expanded (true) or collapsed (false).

Methods

MethodDescription
deleteGroupDeletes this instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.
repeatGroupDuplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.
repeatGroupAsyncDuplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.

MobileCRM.UI.QuestionnaireForm.Group.deleteGroup Method

Deletes this instance of repeatable group with all its questions and adjusts the repeatIndex for all instances of the same template group with higher index.

Arguments

ArgumentTypeDescription
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.Group.repeatGroup Method

Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.

Arguments

ArgumentTypeDescription
copyValuesBooleanOptional parameter determining whether the group values should be copied to the new instance of this group.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.Group.repeatGroupAsync Method

Duplicates repeatable group with all its questions. The name of the group will contain the lowest available repeatIndex and suffix in form #00X.

Arguments

ArgumentTypeDescription
copyValuesBooleanOptional parameter determining whether the group values should be copied to the new instance of this group.

Return value

Type: Promise

A promise that resolves when the group is duplicated.


MobileCRM.UI.QuestionnaireForm.Question Object

Properties

PropertyTypeDescription
idStringGets the id of this question record.
nameStringGets the name of the question item.
labelStringGets or sets the question item label.
indexNumberGets the index of the question item.
groupIdStringGets the id of parent question group (may be empty).
descriptionStringGet or sets the question item description.
typeNumberGets the value type of the question item.
valueAnyGets current answer value. To change it, use trySetAnswer method.
styleStringGets or sets the question item style name.
isAnsweredBooleanIndicates whether the item is answered.
isVisibleBooleanIndicates whether the item is visible.
isEnabledBooleanIndicates whether the item is enabled.
focusBooleanSet to true to focus the question item.
validateBooleanIndicates whether the item should be validated.
errorMessageStringHolds the error message text related to current value of the question item.

Methods

MethodDescription
focusAsynchronously sets the focus on this question.
trySetAnswerAsynchronously sets the answer value for this question.

MobileCRM.UI.QuestionnaireForm.Question.focus Method

Asynchronously sets the focus on this question.

Arguments

ArgumentTypeDescription
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.QuestionnaireForm.Question.trySetAnswer Method

Asynchronously sets the answer value for this question.

Arguments

ArgumentTypeDescription
answeranyA value that has to be set as answer. It must correspond to the type of question (String/Number/Reference/Guid).
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.ReportForm Object

[v8.1] Represents the Dynamics CRM report form object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
allowedReportIdsArrayThe list of report entity ids that has to be included in the report form selector.
allowedLanguagesArrayThe list of LCID codes of the languages that has to be included into the report form selector. The number -1 stands for "Any language".
defaultReportStringThe primary name of the report entity that should be pre-selected on the report form.

Methods

MethodDescription
showShows the Dynamics CRM report form.

MobileCRM.UI.ReportForm.show Method

Shows the Dynamics CRM report form.

Arguments

ArgumentTypeDescription
successfunction(obj)The callback function that is called if the report form was successfully opened.
failedfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.RoutePlan Object

[v14.2] Represents the Javascript equivalent view of RoutePlan form object.

This object is not available under Essential license.

Properties

PropertyTypeDescription
myRouteDynamicEntity[]A list of route entities.
completedEntitiesDynamicEntity[] A list of completed entities that are about to be removed from route plan.
routeEntityNameStringLogical name of the route visit entity.
routeDayDateCurrently selected route day.
isDirtyBooleanControls whether the form is dirty and requires save, or whether it can be closed.

Methods

MethodDescription
suspendPostSaveSuspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.
suspendSaveSuspends current "onSave" process and allows performing asynchronous tasks to save the data.

Functions

FunctionDescription
onItemAddedBinds or unbinds the handler for "Item Added" event.
onItemCompletedBinds or unbinds the handler for "Item Completed" event.
onItemPostSaveBinds or unbinds the handler for further actions on saved visit entity.
onItemRemovedBinds or unbinds the handler for "Item Removed" event.
onItemSaveBinds or unbinds the handler for validating single visit entity save.
onPostSaveBinds or unbinds the handler for further actions on saved route.
onRouteReloadedBinds or unbinds the handler called after route is reloaded.
onSaveBinds or unbinds the handler for route save validation.
requestObjectRequests the managed RoutePlan object.

MobileCRM.UI.RoutePlan.suspendPostSave Method

Suspends current "onPostSave" operations and allows performing another asynchronous tasks before the form is closed.

Return value

Type: Object

A request object with single method "resumePostSave" which has to be called to resume the post-save operations.


MobileCRM.UI.RoutePlan.suspendSave Method

Suspends current "onSave" process and allows performing asynchronous tasks to save the data.

Return value

Type: Object

A request object with single method "resumeSave" which has to be called with the result (either error message string or "null" in case of success). To cancel the validation without any message, pass "#NoMessage#" text to this method.


MobileCRM.UI.RoutePlan.onItemAdded Function

Binds or unbinds the handler for "Item Added" event.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "entity" carrying DynamicEntity object of the new visit record.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onItemCompleted Function

Binds or unbinds the handler for "Item Completed" event.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "entity" carrying DynamicEntity object af completed visit record being removed from route plan.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onItemPostSave Function

Binds or unbinds the handler for further actions on saved visit entity.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "errorMessage" that can be used to cancel save with an error.

Use suspendSave method to suspend the save process if an asynchronous operation is required and property "savedEntity" carrying saved DynamicEntity object.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onItemRemoved Function

Binds or unbinds the handler for "Item Removed" event.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "entity" carrying DynamicEntity object of unsaved visit record being removed from route plan.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onItemSave Function

Binds or unbinds the handler for validating single visit entity save.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "errorMessage" that can be used to cancel save with an error and property "entityToSave" carrying visit DynamicEntity record.

Use suspendSave method to suspend the save process if an asynchronous operation is required.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onPostSave Function

Binds or unbinds the handler for further actions on saved route.

Bound handler is called with the RoutePlan object as an argument.

Use suspendPostSave method to suspend the post-save process if an asynchronous operation is required.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onRouteReloaded Function

Binds or unbinds the handler called after route is reloaded.

Bound handler is called with the RoutePlan object as an argument on start or when day or filter field is changed.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.onSave Function

Binds or unbinds the handler for route save validation.

Bound handler is called with the RoutePlan object as an argument.

The RoutePlan context object contains property "errorMessage" that can be used to cancel save with an error.

Use suspendSave method to suspend the save process if an asynchronous operation is required.

Arguments

ArgumentTypeDescription
handlerfunction(RoutePlan)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.RoutePlan.requestObject Function

Requests the managed RoutePlan object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of RoutePlan object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(platform)The callback function that is called asynchronously with serialized RoutePlan object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.TourplanForm Object

Represents the Javascript equivalent tourplan form object.

This object cannot be created directly. To obtain/modify this object, use MobileCRM.UI.TourplanForm.requestObject function.

This object is not available under Essential license.

Properties

PropertyTypeDescription
isDirtyBooleanIndicates whether the form has been modified.
isLoadedBooleanGets or sets whether the form is loaded.
viewMobileCRM.UI._AppointmentViewGets tourplan form view MobileCRM.UI.AppointmentView.

Functions

FunctionDescription
onCreateNew[v11.3] Binds or unbinds the handler for creating new appointment after long-pressing on calendar.
requestObjectRequests the managed TourplanForm object.
setDateSets the current date in calendar view (Tourplan).
setModeSets the calendar view (Tourplan) mode.

MobileCRM.UI.TourplanForm.onCreateNew Function

[v11.3] Binds or unbinds the handler for creating new appointment after long-pressing on calendar.

Bound handler is called with the TourplanForm object as an argument. The context object contains "start", "end", "entityName" properties and optionally "subject" property.

Arguments

ArgumentTypeDescription
handlerfunction(tourplanForm)The handler function that has to be bound or unbound.
bindBooleanDetermines whether to bind or unbind the handler.
scopeObjectThe scope for handler calls.

MobileCRM.UI.TourplanForm.requestObject Function

Requests the managed TourplanForm object.

Method initiates an asynchronous request which either ends with calling the errorCallback or with calling the callback with Javascript version of TourplanForm object. See MobileCRM.Bridge.requestObject for further details.

Arguments

ArgumentTypeDescription
callbackfunction(platform)The callback function that is called asynchronously with serialized TourplanForm object as argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI.TourplanForm.setDate Function

Sets the current date in calendar view (Tourplan).

Arguments

ArgumentTypeDescription
dateDateA date to set.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.

MobileCRM.UI.TourplanForm.setMode Function

Sets the calendar view (Tourplan) mode.

Arguments

ArgumentTypeDescription
modeMobileCRM.UI.TourplanViewModeA mode to set.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.

MobileCRM.UI.TourplanViewMode Object

Enumeration class holding constants for MobileCRM.UI.TourplanForm.

Properties

PropertyTypeDescription
AgendaNumberAgenda view.
DayNumber Day view.
WeekNumber Week view.
MonthNumber Month view.

MobileCRM.UI.ViewController Object

Represents the Javascript equivalent of view controller (map/web content).

This object is not available under Essential license.

Functions

FunctionDescription
createCommandOverrides the form's primary/secondary command button.

MobileCRM.UI.ViewController.createCommand Function

Overrides the form's primary/secondary command button.

Arguments

ArgumentTypeDescription
primaryBooleantrue, for primary button; false, for secondary button.
labelsArray/StringAn array of labels or single label.
callbackFunctionA callback which is called when command is launched.
scopeObjectA scope, in which the callback has to be called.

MobileCRM.UI.ViewDefinition Object

Represents the entity view definition.

Properties

PropertyTypeDescription
entityNameStringGets the entity this view is for.
nameStringGets the name of the view.
fetchStringGets the fetchXml query.
kindNumberGets the kind of the view (public, associated, etc.).
versionNumberGets the version.
buttonsStringGets the view buttons.
selectorStringGets the view template selector workflow.

Functions

FunctionDescription
loadEntityViewsAsynchronously loads all view definitions for given entity.

MobileCRM.UI.ViewDefinition.loadEntityViews Function

Asynchronously loads all view definitions for given entity.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name.
callbackfunction(viewDefArray)The callback function which is called asynchronously. Callback will obtain an array of ViewDefinition objects.
errorCallbackfunction(errorMsg)The errorCallback which is called asynchronously in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.UI._AppointmentView Object

Represents the Javascript equivalent view of tourplan form object.

Properties

PropertyTypeDescription
nameStringGets the name of view.
isVisibleBooleanGets or sets whether the view is visible.
modeMobileCRM.UI.TourplanViewModeGets a view mode MobileCRM.UI.TourplanViewMode.
currentDateDateGets the current date of displayed view.

MobileCRM.UI._Controller Object

Represents the Javascript equivalent of the view controller object.

Properties

PropertyTypeDescription
isDirtyBooleanGets or sets whether the controller contains dirty data that should be saved.
isLoadedBooleanGets or sets whether the controller is loaded.
viewMobileCRM.UI._ViewGets or sets the view (control) instance.

MobileCRM.UI._DetailItem Object

Represents the Javascript equivalent of detail item which is controlling the field editing.

Properties

PropertyTypeDescription
dataMemberStringGets or sets the item data binding.
errorMessageStringGets or sets the item error message displayed during validation.
isEnabledBooleanGets or sets whether the item is editable.
isNullableBoolean Gets or sets whether the item value can be "null".
isVisibleBooleanGets or sets whether the item is visible.
labelStringGets or sets the item label.
nameStringGets or sets the item name.
validateBooleanGets or sets whether the item needs validation.
 
isPassword (text items only)BooleanGets or sets whether the text value should be masked. Used for password entry.
kind (text items only)NumberGets or sets the value kind (0 for Text, 1 for Email, 2 for Url, 3 for Phone).
maxLength (text items only)NumberGets to sets the maximum text length.
numberOfLines (text items only)NumberNumber of lines to display. Default is one.
value (text items only)StringGets or sets the bound item value.
 
decimalPlaces (numeric items only)NumberGets or sets the number of decimal places.
displayFormat (numeric items only)String
increment (numeric items only)NumberGets or sets the increment (if the Up/Down control is visible).
maximum (numeric items only)NumberGets or sets the maximum allowed value.
minimum (numeric items only)NumberGets or sets the minimum allowed value.
upDownVisible (numeric items only)BooleanGets or sets whether the up/down control is visible.
value (numeric items only)NumberGets or sets the bound item value.
 
textChecked (boolean items only)StringGets or sets the text for checked state.
textUnchecked (boolean items only)StringGets or sets the text for unchecked state.
value (boolean items only)BooleanGets or sets the bound item value.
 
parts (DateTime items only)NumberGets or sets whether to display and edit the date, time or both (0=both, 1=date only, 2=time only).
value (DateTime items only)DateGets or sets the bound item value.
 
value (Duration items only)NumberGets or sets the bound item value (duration in minutes).
 
displayMember (OptionSet items only)StringGets or sets the name of the property whose value is used as the label of an option.
value (OptionSet items only)NumberGets or sets the bound item value (selected value).
valueMember (OptionSet items only)StringGets or sets the name of the property whose value is used as the value of an option. Set "null" to use the option object as the value.
 
isMultiline (Link items only)BooleanGets or sets whether the item is multiline. Default is false.
value (Link items only)MobileCRM.ReferenceGets or sets the bound item value (a MobileCRM.Reference object or "null").
 

MobileCRM.UI._DetailView Object

Represents the Javascript equivalent of detail view with set of items responsible for fields editing.

This object is not available under Essential license.

Properties

PropertyTypeDescription
isDirtyBooleanIndicates whether the value of an item has been modified.
isEnabledBooleanGets or sets whether the all items are enabled or disabled.
isVisibleBooleanGets or sets whether the view is visible.
itemsArrayAn array of MobileCRM.UI._DetailItem objects
nameStringGets the name of the view

Methods

MethodDescription
addItemToGrid[since 13.1] Add detail item to desired position in to grid.
executeItemAction[v19.1] Executes the detail item specific action, e.g. scan barcode.
filterStringListOptions[v18.1] Filters allowed StringList options in MobileCRM.UI.DetailViewItems.LinkItem.
getItemByNameReturns the MobileCRM.UI._DetailItem with specified name or "null".
getItemContentAsync[v19.1] Gets the content of detail item as string, e.g. base64 encoded binary data of image item.
getItemIndexReturns index of MobileCRM.UI._DetailItem with specified name or -1.
insertItem[v8.0] Inserts the MobileCRM.UI.DetailViewItems.Item into this detailed view.
insertItems[v8.0] Inserts the MobileCRM.UI.DetailViewItems.Item into this detailed view.
registerClickHandler[v8.0] Installs the handler which has to be called when user clicks on the link item.
removeItem[v8.0] Removes the item from this detailed view.
removeItems[v8.0] Removes all items from this detailed view.
startEditItem[v9.2] Starts editing the detail item and sets the focus on it.
updateComboItemDataSource[v9.1] Changes the data source for CombobBoxitem MobileCRM.UI.DetailViewItems.ComboBoxItem.
updateLinkItemViews[v10.1] Changes the ComboBoxItem views and/or filters.

MobileCRM.UI._DetailView.addItemToGrid Method

[since 13.1] Add detail item to desired position in to grid.

Arguments

ArgumentTypeDescription
gridNameString name of grid item.
itemMobileCRM.UI.DetailViewItems.ItemDetail item MobileCRM.UI.DetailViewItems.Itemobject.
columnNumberOptional Column x axis parameter, default is 0.
rowNumberOptional Row y axis parameter, default is 0.
colSpanNumberOptional Column width x axis width , default is 1.
rowSpanNumberOptional Row width y axis width, default is 1.

MobileCRM.UI._DetailView.executeItemAction Method

[v19.1] Executes the detail item specific action, e.g. scan barcode.

Arguments

ArgumentTypeDescription
indexNumberSelected item index.

MobileCRM.UI._DetailView.filterStringListOptions Method

[v18.1] Filters allowed StringList options in MobileCRM.UI.DetailViewItems.LinkItem.

Arguments

ArgumentTypeDescription
indexNumberItem index on the view.
allowedOptionsstring[]An array with options to be allowed (e.g. ["New", "Completed"]).
defaultValueStringNew data source default value. If not defined, the first item from allowedOptions will be used. Ignored, if value isn't in allowedOptions.

MobileCRM.UI._DetailView.getItemByName Method

Returns the MobileCRM.UI._DetailItem with specified name or "null".

Arguments

ArgumentTypeDescription
nameStringA name of requested detail item.

Return value

Type: MobileCRM.UI._DetailItem

An instance of MobileCRM.UI._DetailItem with specified name or "null".


MobileCRM.UI._DetailView.getItemContentAsync Method

[v19.1] Gets the content of detail item as string, e.g. base64 encoded binary data of image item.

Arguments

ArgumentTypeDescription
itemNameStringThe name of the detail item.

MobileCRM.UI._DetailView.getItemIndex Method

Returns index of MobileCRM.UI._DetailItem with specified name or -1.

Arguments

ArgumentTypeDescription
nameStringA name of requested detail item.

Return value

Type: Number

Index of MobileCRM.UI._DetailItem with specified name or -1.


MobileCRM.UI._DetailView.insertItem Method

[v8.0] Inserts the MobileCRM.UI.DetailViewItems.Item into this detailed view.

Arguments

ArgumentTypeDescription
itemMobileCRM.UI.DetailViewItems.ItemAn item to be added.
indexNumberAn index on which the item should be placed. Set to -1 to append the item at the end.

MobileCRM.UI._DetailView.insertItems Method

[v8.0] Inserts the MobileCRM.UI.DetailViewItems.Item into this detailed view.

Arguments

ArgumentTypeDescription
itemsArray(MobileCRM.UI.DetailViewItems.Item)An array of items to be added.
indexNumberAn index on which the items should be placed. Set to -1 to append the items at the end.

MobileCRM.UI._DetailView.registerClickHandler Method

[v8.0] Installs the handler which has to be called when user clicks on the link item.

Arguments

ArgumentTypeDescription
itemMobileCRM.UI.DetailViewItems.LinkItemAn item
callbackfunction(String, String)A callback which is called when user clicks on the link item. It obtains the link item name and the detail view name as arguments.
scopeObjectA scope, in which the callback has to be called.

MobileCRM.UI._DetailView.removeItem Method

[v8.0] Removes the item from this detailed view.

Arguments

ArgumentTypeDescription
indexNumberAn index of the item which has to be removed.

MobileCRM.UI._DetailView.removeItems Method

[v8.0] Removes all items from this detailed view.

Arguments

ArgumentTypeDescription
indexesArrayAn array of item indexes that has to be removed.

MobileCRM.UI._DetailView.startEditItem Method

[v9.2] Starts editing the detail item and sets the focus on it.

Arguments

ArgumentTypeDescription
indexNumberSelected item index.

MobileCRM.UI._DetailView.updateComboItemDataSource Method

[v9.1] Changes the data source for CombobBoxitem MobileCRM.UI.DetailViewItems.ComboBoxItem.

Arguments

ArgumentTypeDescription
indexNumberItem index on the view.
listDataSourceObjectThe data source object (e.g. {"label1":1, "label2":2}).
valueTypeStringType of list data source element value. Default is string, allowed int, string.
defaultValueString|NumberNew data source default value. If not defined, the first item from listDataSource will be used.

MobileCRM.UI._DetailView.updateLinkItemViews Method

[v10.1] Changes the ComboBoxItem views and/or filters.

Arguments

ArgumentTypeDescription
indexNumberItem index on the view.
dialogSetupMobileCRM.UI.DetailViewItems.LookupSetupLookup setup for modal lookup dialog.
inlinePickSetupMobileCRM.UI.DetailViewItems.LookupSetupOptional setup for inline lookup picker. Leave empty to use the same setup as modal dialog.
dialogOnlyBooleanOptional - indicates whether to allow the inline picker. Set **true** to disable the inline picker and always use the modal dialog. Set **false**; to allow the inline picker. Default value is **true**
allowCreateNewBooleanOptional - [v18.0] Indicates whether to allow creation of new items. Default value is **true**.

MobileCRM.UI._DocumentController Object

Represents Media tab controller containing specific kind of document.

This field is not available directly, it is special type of _Controller for Media tab. Use EntityForm.getController to get it.

Properties

PropertyTypeDescription
isEmptybooleanIndicated whether the Media tab is empty.
noteSubjectStringGets Media tab note subject used for identifying right instance of related attachment.
viewMobileCRM.UI._DocumentView_Document view presenting attached document.

MobileCRM.UI._DocumentInfo Object

Represents information about attached document.

Properties

PropertyTypeDescription
documentKindnumber0=None, 1=Signature, 2=WebPage, 3=Image, 4=OtherFileType
fileSizenumberAttachment file size.
imageHeightnumberImage attachment height.
imageWidthnumberImage attachment width.

MobileCRM.UI._DocumentView Object

Represents the document view object containing the attachment document (binary field content).

Properties

PropertyTypeDescription
isVisibleBooleanGets or sets whether the view is visible.
nameStringGets the name of the view.
documentInfo_DocumentInfoContains information about attached document.
fileNamestringAttached document file name".
isEmptybooleanIndicates whether the view is empty or whether user has already provided a document.
isReadOnlybooleanIndicates whether the view is read-only.
mimeTypestringAttached document file MIME type.
inkTitlestringSignature title.
saveSignatureAsImagebooleanSignature save mode: image or SVG.
strokeWidthnumberSignature stroke width.
maxImageWidthnumberMaximum allowed image width. Zero or negative numbers stand for no preference.
maxImageHeightnumberMaximum allowed image height. Zero or negative numbers stand for no preference.
desiredRationumberDesired width/height ratio. Zero values stand for no preference. Negative ratio means that reverse ratio is also allowed (accepts both 4:3 and 3:4).
enforcementModenumberDefines an action to take when image is included into ImageView (captured or selected from gallery). 0=NoEnforcement, 1=AutoCrop, 2=AutoResize, 3=AutoCrop&resize, 32768=OpenImageEditor.

MobileCRM.UI._EntityList Object

Represents the Javascript equivalent of the entity list controller object.

Properties

PropertyTypeDescription
allowAddExistingBooleanGets or sets whether adding an existing entity is allowed. If false only the creation of new entities is allowed, otherwise the user can selected an existing entity. Adding an existing entity works only when the list is displaying a list of related entities.
allowedViewsObjectGets or sets the allowed views (e.g. {"view1":"Label 1", "view2":"Label 2"};).
entityNameStringGets the name of the entities in this list.
hasMapViewsBooleanGets whether the list has a view that can be displayed on map.
internalNameStringGets the internal list name. Used for localization and image lookup.
isDirtyBooleanGets or sets whether the list is dirty.
isLoadedBooleanGets or sets whether the list is loaded.
listButtonsArrayGets or sets the list buttons.
listViewMobileCRM.UI._ListViewGets the list view control.

MobileCRM.UI._ListView Object

Represents the Javascript equivalent of the list view (control) object.

Properties

PropertyTypeDescription
isVisibleBooleanGets or sets whether the view is visible.
nameStringGets the name of the view.
selectedIndexNumberGets or sets the index of the selected row.
templateIndexNumberGets or sets the index of the template used to paint rows in the normal state.
selectedTemplateIndexNumberGets or sets the index of the template used to paint rows in the selected state.
isScrollEnabledBooleanGets or sets whether list can scroll. Default true.

MobileCRM.UI._View Object

Represents the Javascript equivalent of the view (control) object.

Properties

PropertyTypeDescription
isVisibleBooleanGets or sets whether the view is visible.
nameStringGets the name of the view.

MobileCRM.UI.DetailViewItems Namespace

Contains a set of objects representing particular detail view items.

Objects

ObjectDescription
ButtonItem[8.0] Represents the MobileCRM.UI._DetailView duration item.
CheckBoxItem[8.0] Represents the MobileCRM.UI._DetailView checkbox item.
ComboBoxItem[8.0] Represents the MobileCRM.UI._DetailView combobox item.
DateTimeItem[8.0] Represents the MobileCRM.UI._DetailView date/time item.
DetailGridLength[13.0] Represents the grid length in grid unit type.
DropDownFormatAn enumeration defining the values of LinkItem's dropdown format.
DurationItem[8.0] Represents the MobileCRM.UI._DetailView duration item.
GridItem[13.0] Represents the MobileCRM.UI._DetailView grid item.
GridStyleDefintion[13.0] Represents the columns and rows style definition for grid item.
Item[8.0] Represents the MobileCRM.UI._DetailView item.
LinkItem[8.0] Represents the MobileCRM.UI._DetailView link item.
LookupSetupRepresents a configuration for lookup and inline lookup.
NumericItem[8.0] Represents the MobileCRM.UI._DetailView numeric item.
SeparatorItem[8.0] Represents the MobileCRM.UI._DetailView separator item.
TextBoxItem[8.0] Represents the MobileCRM.UI._DetailView text item.

MobileCRM.UI.DetailViewItems.ButtonItem Object

[8.0] Represents the MobileCRM.UI._DetailView duration item.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.ButtonItem object.

MobileCRM.UI.DetailViewItems.ButtonItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.ButtonItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
clickTextStringGets or sets the text content of click button.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.CheckBoxItem Object

[8.0] Represents the MobileCRM.UI._DetailView checkbox item.

Properties

PropertyTypeDescription
textCheckedStringGets or sets the text for checked state.
textUncheckedStringGets or sets the text for unchecked state.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.CheckBoxItem object.

MobileCRM.UI.DetailViewItems.CheckBoxItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.CheckBoxItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.ComboBoxItem Object

[8.0] Represents the MobileCRM.UI._DetailView combobox item.

Properties

PropertyTypeDescription
listDataSourceObjectGets or sets the object with props and values to be displayed in the combo list (e.g. {"label1":1, "label2":2}).

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.ComboBoxItem object.

MobileCRM.UI.DetailViewItems.ComboBoxItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.ComboBoxItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.DateTimeItem Object

[8.0] Represents the MobileCRM.UI._DetailView date/time item.

Properties

PropertyTypeDescription
minimumDateGets or sets the minimum allowed value.
maximumDateGets or sets the maximum allowed value.
partsNumber Gets or sets whether to display and edit the date, time or both.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.DateTimeItem object.

MobileCRM.UI.DetailViewItems.DateTimeItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.DateTimeItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.DetailGridLength Object

[13.0] Represents the grid length in grid unit type.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.DetailGridLength object.

MobileCRM.UI.DetailViewItems.DetailGridLength.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.DetailGridLength object.

Arguments

ArgumentTypeDescription
valueStringGrid length value.
gridUnitTypeMobileCRM.UI.DetailViewItems.DetailGridUnitTypeDefines the grid MobileCRM.UI.DetailViewItems.DetailGridUnitType unit type.

MobileCRM.UI.DetailViewItems.DropDownFormat Object

An enumeration defining the values of LinkItem's dropdown format.

Properties

PropertyTypeDescription
StringListNumberStringList dropdown format.
StringListInputNumberStringListInput dropdown format.
MultiStringListNumberMultiStringList dropdown format.
MultiStringListInputNumberMultiStringListInput dropdown format.

MobileCRM.UI.DetailViewItems.DurationItem Object

[8.0] Represents the MobileCRM.UI._DetailView duration item.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.DurationItem object.

MobileCRM.UI.DetailViewItems.DurationItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.DurationItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.GridItem Object

[13.0] Represents the MobileCRM.UI._DetailView grid item.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.GridItem object.
addItem[since 13.1] Add detail item to desired position in to grid.

MobileCRM.UI.DetailViewItems.GridItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.GridItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.
gridStyleDefintionMobileCRM.UI.DetailViewItems.GridStyleDefintionGets or sets the style definition for grid item.

MobileCRM.UI.DetailViewItems.GridItem.addItem Method

[since 13.1] Add detail item to desired position in to grid.

Arguments

ArgumentTypeDescription
itemMobileCRM.UI.DetailViewItems.ItemDetail item MobileCRM.UI.DetailViewItems.Itemobject.
columnNumberOptional Column x axis parameter, default is 0.
rowNumberOptional Row y axis parameter, default is 0.
colSpanNumberOptional Column width x axis width , default is 1.
rowSpanNumberOptional Row width y axis width, default is 1.

MobileCRM.UI.DetailViewItems.GridStyleDefintion Object

[13.0] Represents the columns and rows style definition for grid item.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.GridStyleDefintion object.

MobileCRM.UI.DetailViewItems.GridStyleDefintion.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.GridStyleDefintion object.

Arguments

ArgumentTypeDescription
columnsArrayMobileCRM.UI.DetailViewItems.DetailGridLength>">Defines the columns style.
rowsArrayMobileCRM.UI.DetailViewItems.DetailGridLength>">Defines the rows style.

MobileCRM.UI.DetailViewItems.Item Object

[8.0] Represents the MobileCRM.UI._DetailView item.

Properties

PropertyTypeDescription
nameStringGets or sets the item name.
labelStringGets or sets the item label.
dataMemberStringGets or sets the name of the property containing the item value in data source objects.
errorMessageStringGets or sets the item error message.
supportingTextStringGets or sets the item supporting text (e.g. description).
isEnabledBooleanGets or sets whether the item is editable.
isVisibleBooleanGets or sets whether the item is visible.
valueObjectGets or sets the bound item value.
isNullableBooleanGets or sets whether the item value can be "null".
validateBooleanGets or sets whether the item needs validation.
styleStringThe name of the Woodford item style.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.Item object.

MobileCRM.UI.DetailViewItems.Item.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.Item object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.LinkItem Object

[8.0] Represents the MobileCRM.UI._DetailView link item.

Properties

PropertyTypeDescription
isMultiLineBooleanGets or sets whether the item is multiline. Default is false.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.LinkItem object.

MobileCRM.UI.DetailViewItems.LinkItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.LinkItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.
listDropDownFormatMobileCRM.UI.DetailViewItems.DropDownFormatDefines item's drop down format.

MobileCRM.UI.DetailViewItems.LookupSetup Object

Represents a configuration for lookup and inline lookup.

Defines the lookup records filter for updateLinkItemViews

Methods

MethodDescription
addFilterDefines a fetch XML filter for entity records.
addViewAppends an entity view to the list of allowed views.

MobileCRM.UI.DetailViewItems.LookupSetup.addFilter Method

Defines a fetch XML filter for entity records.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
filterXmlstringA string defining the fetch XML which has to be applied as filter for entity records.

MobileCRM.UI.DetailViewItems.LookupSetup.addView Method

Appends an entity view to the list of allowed views.

Arguments

ArgumentTypeDescription
entityNamestringEntity logical name.
viewNamestringA name of the view.
isDefaultBooleantrue, if the view should be set as default.

MobileCRM.UI.DetailViewItems.NumericItem Object

[8.0] Represents the MobileCRM.UI._DetailView numeric item.

Properties

PropertyTypeDescription
minimumNumberGets or sets the minimum allowed value.
maximumNumberGets or sets the maximum allowed value.
incrementNumberGets or sets the increment (if the upDownVisible is true).
upDownVisibleBooleanGets or sets whether the up/down control is visible.
decimalPlacesNumberGets or sets the number of decimal places.
displayFormatStringGets or sets the value format string.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.NumericItem object.

MobileCRM.UI.DetailViewItems.NumericItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.NumericItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.SeparatorItem Object

[8.0] Represents the MobileCRM.UI._DetailView separator item.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.SeparatorItem object.

MobileCRM.UI.DetailViewItems.SeparatorItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.SeparatorItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.UI.DetailViewItems.TextBoxItem Object

[8.0] Represents the MobileCRM.UI._DetailView text item.

Properties

PropertyTypeDescription
numberOfLinesNumberGets or sets the number of lines to display. Default is one.
isPasswordBooleanGets or sets whether the text value should be masked. Used for password entry.
maxLengthNumberGets to sets the maximum text length.
kindNumberGets or sets the value kind (Text=0, Email=1, Url=2, Phone=3, Barcode=4).
placeholderTextNumberGets or sets the text that is displayed in the control until the value is changed by a user action or some other operation. Default is empty string.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.UI.DetailViewItems.TextBoxItem object.

MobileCRM.UI.DetailViewItems.TextBoxItem.constructor Method

Constructs an instance of MobileCRM.UI.DetailViewItems.TextBoxItem object.

Arguments

ArgumentTypeDescription
nameStringDefines the item name.
labelStringDefines the item label.

MobileCRM.Services Namespace

Contains non-UI classes for accessing documents...

Objects

ObjectDescription
AIVision[v12.3] Represents a service for AI image recognition.
AIVisionSettings[v12.3] Represents the settings for AI image recognition service.
AddressBookService[v9.1] Represents a service for accessing the address book.
AudioRecorder[v10.0] Represents a service for recording an audio.
ChatService[v9.3] Represents a service for sending instant messages to users or shared channels.
CompanyInformationRepresents CompanyInformation object.
DocumentService[v8.1] Represents a service for acquiring the documents.
DynamicsReport[v10.0] Represents a service for downloading MS Dynamics reports.
FileInfoCarries the result of a DocumentService operation.
GeoAddress[v9.3] Represents a service for translating geo position into the civic address and back.
GeoFenceRecord[v17.1] Represents geo-fence definition record.
GeoFencingService[v17.1] Represents geo-fencing service.
HttpWebRequest[v11.0] Instance of http web request.
SynchronizationResult[v8.1] Represents the synchronization result.
ZebraScannerRepresents a service for scanning barcodes using Zebra scanner.

MobileCRM.Services.AIVision Object

[v12.3] Represents a service for AI image recognition.

Properties

PropertyTypeDescription
actionnumberSets action for AI vision service. Capture photo or Select picture.
settingsArrayArray sets of json formated prediction key and url.

Methods

MethodDescription
recognizeCapturedPhoto[v12.3] Recognize captured photo using AIVison service.
recognizeSelectedPicture[v12.3] Select photo and recognize it with AIVison service.

Functions

FunctionDescription
create[v12.3]Create AIVsion instance using MobileCRM.Services.AIVisionSettings object.
createFromEntity[v12.3]Create AIVsion instance using entity name. The name is used to get settings from Woodford AI Image Recognition configuration.

MobileCRM.Services.AIVision.recognizeCapturedPhoto Method

[v12.3] Recognize captured photo using AIVison service.

Arguments

ArgumentTypeDescription
sucessCallbackfunctionA callback function that is called with the object having array of tags and its probability and file path properties. {tags:[{tag:"", probability:""}], filePath:""}
failureCallbackfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AIVision.recognizeSelectedPicture Method

[v12.3] Select photo and recognize it with AIVison service.

Arguments

ArgumentTypeDescription
sucessCallbackfunctionA callback function that is called with the object having array of tags and its probability and file path properties. {tags:[{tag:"", probability:""}], filePath:""}
failureCallbackfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AIVision.create Function

[v12.3]Create AIVsion instance using MobileCRM.Services.AIVisionSettings object.

Arguments

ArgumentTypeDescription
settingsMobileCRM.Services.AIVisionSettingsAIVision settings.

MobileCRM.Services.AIVision.createFromEntity Function

[v12.3]Create AIVsion instance using entity name. The name is used to get settings from Woodford AI Image Recognition configuration.

Arguments

ArgumentTypeDescription
entityNameStringThe entity name of Woodford AI Image Recognition configuration.

MobileCRM.Services.AIVisionSettings Object

[v12.3] Represents the settings for AI image recognition service.

Properties

PropertyTypeDescription
modelNameStringGets or sets the model name.
predictionKeyStringGets or sets the model prediction key.
urlStringGets or sets the url to train model.
serviceTypeStringGets or sets the service type. By default we use Azure.

MobileCRM.Services.AddressBookService Object

[v9.1] Represents a service for accessing the address book.

Methods

MethodDescription
getContact[v9.1] Gets an address book contact by its ID.

Functions

FunctionDescription
getService[v9.1] Gets an instance of AddressBookService object.

Objects

ObjectDescription
AddressBookRecord

MobileCRM.Services.AddressBookService.getContact Method

[v9.1] Gets an address book contact by its ID.

Arguments

ArgumentTypeDescription
idStringRequested contact id.
callbackfunction(MobileCRM.Services.AddressBookService.AddressBookRecord)The callback function which is called asynchronously with MobileCRM.Services.AddressBookService.AddressBookRecord object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AddressBookService.getService Function

[v9.1] Gets an instance of AddressBookService object.

Arguments

ArgumentTypeDescription
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

Return value

Type: MobileCRM.Services.AddressBookService

An instance of AddressBookService object.


MobileCRM.Services.AddressBookService.AddressBookRecord Object

Properties

PropertyTypeDescription
recordIdStringRecord id.
firstNameStringRecord first name.
lastNameStringRecord last name.
middleNameStringRecord middle name.
nickNameStringRecord nick name.
jobTitleStringJob title.
organizationStringOrganization name.
prefixStringName prefix (Title) name.
suffixStringName suffix (Title) name.
geoArrayAddress GPS coordinates.
urlStringWeb page URL of record.

MobileCRM.Services.AudioRecorder Object

[v10.0] Represents a service for recording an audio.

Methods

MethodDescription
getRecordBase64[v10.0] Returns recorded audio from microphone as base64 string
getRecordFilePath[v10.0] Returns absolute path to the file containing the record
stopRecording[v10.0] Stops recording audio from microphone

Functions

FunctionDescription
startRecording[v10.0] Starts recording audio from microphone

MobileCRM.Services.AudioRecorder.getRecordBase64 Method

[v10.0] Returns recorded audio from microphone as base64 string

Arguments

ArgumentTypeDescription
callbackfunction(String)The callback function that is called asynchronously with the base64-encoded recording data.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AudioRecorder.getRecordFilePath Method

[v10.0] Returns absolute path to the file containing the record

Arguments

ArgumentTypeDescription
callbackfunction(String)The callback function that is called asynchronously with the file path.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AudioRecorder.stopRecording Method

[v10.0] Stops recording audio from microphone

Arguments

ArgumentTypeDescription
callbackfunctionThe callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.AudioRecorder.startRecording Function

[v10.0] Starts recording audio from microphone

Arguments

ArgumentTypeDescription
callbackfunctionThe callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.ChatService Object

[v9.3] Represents a service for sending instant messages to users or shared channels.

Instance of this object cannot be created directly. Use MobileCRM.Services.ChatService.getService to create new instance.

Properties

PropertyTypeDescription
chatUserMobileCRM.DynamicEntityAn instance of the resco_chatuser entity for current user (either system or external).
userEntityStringThe user entity name (either systemuser or external user entity name).
userIdStringPrimary key (id) of the current user (either system or external).

Methods

MethodDescription
attachNoteToPostCreates a note (annotation) entity with the file attachment related to specified post.
postMessageSubmits a new post into the channel defines by related entity reference.
subscribeToEntityChannelSubscribes current user to a channel specified by related entity.

Functions

FunctionDescription
getServiceAsynchronously creates the new instance of the ChatService.

MobileCRM.Services.ChatService.attachNoteToPost Method

Creates a note (annotation) entity with the file attachment related to specified post.

The file path can be either a relative path to application data or a full path to a file being attached.

Arguments

ArgumentTypeDescription
postIdStringAn id of the resco_chatpost entity which should have the note attached.
filePathStringA path to a file that has to be attached.
mimeTypeStringA MIME type of the file.
subjectStringA text which will be used as note's subject.
callbackfunction(MobileCRM.DynamicEntity)The callback function which is called asynchronously with MobileCRM.DynamicEntity representing newly created annotation record.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.ChatService.postMessage Method

Submits a new post into the channel defines by related entity reference.

Use reference to resco_chattopic entity to specify a shared channel or reference to a peer user to specify the private channel.

Arguments

ArgumentTypeDescription
regardingEntityMobileCRM.ReferenceA reference to an entity that the post should relate to.
textStringThe post content.
callbackfunction(MobileCRM.DynamicEntity)The callback function which is called asynchronously with MobileCRM.DynamicEntity representing newly created resco_chatpost record.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.ChatService.subscribeToEntityChannel Method

Subscribes current user to a channel specified by related entity.

Use reference to resco_chattopic entity to specify a shared channel.

Arguments

ArgumentTypeDescription
regardingEntityMobileCRM.ReferenceReference to an entity that has to be subscribed/unsubscribed.
subscribeBooleanDetermines whether to subscribe or unsubscribe entity channel.
callbackFunctionThe callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.ChatService.getService Function

Asynchronously creates the new instance of the ChatService.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.ChatService)The callback function which is called asynchronously with MobileCRM.Services.ChatService instance as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.CompanyInformation Object

Represents CompanyInformation object.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.Services.CompanyInformation object.

Functions

FunctionDescription
getCompanyInfoFromVatReturn callback with CompanyInformation object with properties name and address

MobileCRM.Services.CompanyInformation.constructor Method

Constructs an instance of MobileCRM.Services.CompanyInformation object.


MobileCRM.Services.CompanyInformation.getCompanyInfoFromVat Function

Return callback with CompanyInformation object with properties name and address

Arguments

ArgumentTypeDescription
vatstringVAT number of company. e.g. "SK2020232390"
callbackfunction(CompanyInformation)The callback function which is called asynchronously in case of success.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService Object

[v8.1] Represents a service for acquiring the documents.

Properties

PropertyTypeDescription
maxImageSizeStringGets or sets the maximum captured image size. If captured image size is greater, the image is resized to specified maximum size [640x480,1024x768,1600x1200,2048x1536,2592x1936 ].
maxUploadImageSizeStringGets or sets the maximum uploaded image size. If uploaded image size is greater then image is resized to specified maximum size [640x480,1024x768,1600x1200,2048x1536,2592x1936 ].
recordQualityStringGets or sets the record quality for audio/video recordings [Low, Medium, High].
allowChooseVideoBooleanIndicates whether the video files should be included into the image picker when selecting the photos. The default is true.
allowMultipleFilesBooleanIndicates whether to allow multiple files for DocumentActions SelectPhoto and SelectFile.[Not implemented on iOS.]
allowCancelHandlerBooleanIndicates whether to allow handling of cancel event. Callback will pass the null argument in this case.

Methods

MethodDescription
capturePhotoAsks the user to capture a photo and calls the async callback with file info.
loadFrom[13.3.4]Asks the user to choose a file and calls the async callback with file info.
loadFromMultiple[13.3.4]Asks the user to choose a multiple files and calls the async callback with file info.
pasteFileTakes the file from clipboard and calls the async callback with file info.
print[v9.1] Prints the document defined by file path.
recordAudioAsks the user to record an audio note and calls the async callback with file info.
recordVideoAsks the user to record an video and calls the async callback with file info.
resizeImage[v11.1] Resize image defined by file path.
saveFileDialog[v11.2] Ask to user to choose a location and saves the passed data as a file at that location.
selectFileAsks the user to choose a file and calls the async callback with file info.
selectMultipleFiles[v14.2.0] Asks the user to choose multiple files and calls the async callback with linked list of file infos (see FileInfo.nextInfo).
selectMultiplePhotos[v11.2.3] Asks the user to choose multiple photos and calls the async callback with linked list of file infos (see FileInfo.nextInfo).
selectPhotoAsks the user to choose a media (image, video, depending on the value of allowChooseVideo property) and calls the async callback with file info.

MobileCRM.Services.DocumentService.capturePhoto Method

Asks the user to capture a photo and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.loadFrom Method

[13.3.4]Asks the user to choose a file and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.loadFromMultiple Method

[13.3.4]Asks the user to choose a multiple files and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.pasteFile Method

Takes the file from clipboard and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.print Method

[v9.1] Prints the document defined by file path.

Arguments

ArgumentTypeDescription
filePathStringA file path.
landscapeBooleanTrue, to print the document in landscape. False, to print it in portrait
errorCallbackfunction(errorMsg)The error callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.recordAudio Method

Asks the user to record an audio note and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.recordVideo Method

Asks the user to record an video and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.resizeImage Method

[v11.1] Resize image defined by file path.

Arguments

ArgumentTypeDescription
filePathStringA file path.
maxWidthNumberMax width.
maxHeightNumberMax height.
callbackfunction(result)A callback function for asynchronous result. In case of success result argument will be true otherwise false.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.saveFileDialog Method

[v11.2] Ask to user to choose a location and saves the passed data as a file at that location.

Arguments

ArgumentTypeDescription
fileNameStringA file name.
fileDataStringBase64 encoded file data.
callbackfunction(result)A callback function for asynchronous result. In case of success result argument will be true otherwise false.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.selectFile Method

Asks the user to choose a file and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.selectMultipleFiles Method

[v14.2.0] Asks the user to choose multiple files and calls the async callback with linked list of file infos (see FileInfo.nextInfo).

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.selectMultiplePhotos Method

[v11.2.3] Asks the user to choose multiple photos and calls the async callback with linked list of file infos (see FileInfo.nextInfo).

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DocumentService.selectPhoto Method

Asks the user to choose a media (image, video, depending on the value of allowChooseVideo property) and calls the async callback with file info.

Arguments

ArgumentTypeDescription
callbackfunction(MobileCRM.Services.FileInfo)The callback function which is called asynchronously with MobileCRM.Services.FileInfo object as an argument.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.DynamicsReport Object

[v10.0] Represents a service for downloading MS Dynamics reports.

Methods

MethodDescription
constructorConstructs an instance of MobileCRM.Services.DynamicsReport object.
downloadDownloads the MS Dynamics report into a file.

MobileCRM.Services.DynamicsReport.constructor Method

Constructs an instance of MobileCRM.Services.DynamicsReport object.


MobileCRM.Services.DynamicsReport.download Method

Downloads the MS Dynamics report into a file.

Arguments

ArgumentTypeDescription
fileNameStringA file name for resulting file. Leave "null" to let app to safely generate the file name and extension.
formatStringOne of following formats (must be supported in Dynamics): XML, CSV, PDF, MHTML, EXCELOPENXML, WORDOPENXML, IMAGE.
successfunction(location)A callback function that is called with the full path to downloaded file.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.FileInfo Object

Carries the result of a DocumentService operation.

In case of canceled document service operation, all properties in this object will be set to "null".

Properties

PropertyTypeDescription
filePathStringGets the full path of the local file.
urlStringGets the local URL of the file which can be used from within this HTML document.
mimeTypeStringGets the file MIME type.
nextInfoMobileCRM.Services.FileInfoGets the next file info or "null".

MobileCRM.Services.GeoAddress Object

[v9.3] Represents a service for translating geo position into the civic address and back.

Properties

PropertyTypeDescription
streetNumberStringGets or sets the street number.
streetStringGets or sets the street.
cityStringGets or sets the city.
zipStringGets or sets the zip code.
stateOrProvinceStringGets or sets the state or province.
countryStringGets or sets the country.
isValidStringIndicates whether the address is valid.

Methods

MethodDescription
toLocationTranslates the civic address represented by GeoAddress object into GPS position.

Functions

FunctionDescription
fromLocationTranslates the geo position represented by latitude and longitude values into the GeoAddress object.

MobileCRM.Services.GeoAddress.toLocation Method

Translates the civic address represented by GeoAddress object into GPS position.

Arguments

ArgumentTypeDescription
successfunction(location)A callback function that is called with the location object having latitude and longitude properties.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.GeoAddress.fromLocation Function

Translates the geo position represented by latitude and longitude values into the GeoAddress object.

Arguments

ArgumentTypeDescription
latitudeNumberLatitude value of the GPS position.
longitudeNumberLongitude value of the GPS position.
successfunction(address)A callback function that is called with the GeoAddress object as argument.
failedfunction(errorMsg)A callback which is called in case of error.
scopeObjectThe scope for callbacks.

MobileCRM.Services.GeoFenceRecord Object

[v17.1] Represents geo-fence definition record.

Properties

PropertyTypeDescription
eventTypeMasknumberDefines numeric mask for geo fence events (Enter = 1, Exit = 2, Both = 3).
idStringUnique id of geo-fence record. If it is associated with some entity record, it must have form logicalname:id (e.g. appointment:4595AA3E-9873-4DC4-B723-C94DE27B82BE).
nameStringHuman-readable name of record used for notifications.
latitudenumberLatitude of geo-fence center.
longitudenumberLongitude of geo-fence center.
radiusnumberGeo-fence radius in meters.
expirationnumberGeo-fence expiration in seconds.

MobileCRM.Services.GeoFencingService Object

[v17.1] Represents geo-fencing service.

Properties

PropertyTypeDescription
isEnabledBooleanIndicates whether the service is active.
realtimeFlushingBooleanIndicates whether the events should be delivered realtime using Resco forwarding service.
logLevelnumberDefines logging verbosity (0=Normal, 1=Diagnostic, -1=None)
notificationMasknumberDefines event mask for showing notifications (0=None, 1=WhenArrived, 2=WhenExited, 3=Always)
businessHoursStringBusiness hours interval (e.g. '9:00-17:00')
businessDaysMasknumberBusiness days mask (the lowest bit is Sunday, the next Monday, ...)

Methods

MethodDescription
updateGeoFences[v17.1] Updates geo-fences being monitored.

MobileCRM.Services.GeoFencingService.updateGeoFences Method

[v17.1] Updates geo-fences being monitored.


MobileCRM.Services.HttpWebRequest Object

[v11.0] Instance of http web request.

Properties

PropertyTypeDescription
userNameStringThe authentication user name.
passwordStringThe authentication password.
methodStringThe http method to use for the request (e.g. "POST", "GET", "PUT").
headersObjectAn object of additional header key/value pairs to send along with requests using the HttpWebRequest.
contentTypeStringThe htt request data content type.
allowRedirectBooleanThe http allows servers to redirect a client request to a different location.
responseEncodingStringThe http web response encoding type. (default: UTF-8), e.g. Base64, ASCII, UTF-8, Binary in case of blob.
responseTypeStringThe HttpWebResponse content type.

Methods

MethodDescription
send[v11.0] Allow to send http web request against an HTTP server.
sendAsync[v13.3] Allow to send http web request against an HTTP server.
setBody[v11.0] Set content body of http web request.
setCredentials[v10.4] Set Network credentials information.
setResponseEncoding[v11.0] Set encoding for content type of http web response.

MobileCRM.Services.HttpWebRequest.send Method

[v11.0] Allow to send http web request against an HTTP server.

Arguments

ArgumentTypeDescription
urlStringThe Url of server where HTTP request will be sent.
callbackfunction(response)A callback function that is called with the web response having "responseCode" and "responseText" properties.
scopeObjectThe scope for callbacks.

MobileCRM.Services.HttpWebRequest.sendAsync Method

[v13.3] Allow to send http web request against an HTTP server.

Arguments

ArgumentTypeDescription
urlStringThe Url of server where HTTP request will be sent.

Return value

Type: Promise<IWebResponse>

A Promise object which is asynchronously resolved with the web response object, or rejected with the web response object, where responseText contains error message.


MobileCRM.Services.HttpWebRequest.setBody Method

[v11.0] Set content body of http web request.

Arguments

ArgumentTypeDescription
bodyStringThe body content.
encodingStringThe encoding (e.g. UTF-8, ASCII, Base64, Binary)

MobileCRM.Services.HttpWebRequest.setCredentials Method

[v10.4] Set Network credentials information.

Arguments

ArgumentTypeDescription
userNameStringThe authentication user name.
passwordStringThe authentication password.

MobileCRM.Services.HttpWebRequest.setResponseEncoding Method

[v11.0] Set encoding for content type of http web response.

Arguments

ArgumentTypeDescription
encodingStringThe encoding (e.g. UTF-8, ASCII, Base64)

MobileCRM.Services.SynchronizationResult Object

[v8.1] Represents the synchronization result.

Properties

PropertyTypeDescription
newCustomizationReadyBooleanIndicates whether the new customization is ready.
customizationDownloadedBooleanIndicates whether the new customization was applied.
dataErrorsEncounteredBooleanIndicates whether some data errors were encountered during sync (cannot upload, delete, change status, owner, etc.).
appWasLockedBooleanApplication was locked.
syncAbortedBooleanSync was aborted.
adminFullSyncBooleanFull sync was requested so background sync was aborted.
webErrorBooleanIndicates whether sync failed due to a communication error (HttpException, for example).
connectFailedBooleanIndicates whether sync could not start because of a connection failure.
wasBackgroundSyncBooleanIndicates whether the last sync was background sync or foreground sync.
OAuthErrorBooleanSync failed because the OAuth access token can't be acquired or refreshed.
syncDownloadRestartedOnBackgroundBooleanNew customization was downloaded. Sync is still downloading data on background.
warningBooleanSync result contains some warnings that are not critical.

MobileCRM.Services.ZebraScanner Object

Represents a service for scanning barcodes using Zebra scanner.

Functions

FunctionDescription
connectConnects to the Zebra scanner.
onScanRegisters the handler for the scan event.
setPowerSet power of antenna the Zebra scanner.
setVolumeSet volume of the Zebra scanner.

MobileCRM.Services.ZebraScanner.connect Function

Connects to the Zebra scanner.

Arguments

ArgumentTypeDescription
successCallbackfunctionThe callback function that is called when the connection is established.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope in which the callback function is called.

MobileCRM.Services.ZebraScanner.onScan Function

Registers the handler for the scan event.

Arguments

ArgumentTypeDescription
handlerfunction(data)The handler function that is called when the scan event is raised.
bindBooleanIndicates whether to bind the handler to the event.
scopeObjectThe scope in which the handler function is called.

MobileCRM.Services.ZebraScanner.setPower Function

Set power of antenna the Zebra scanner.

Arguments

ArgumentTypeDescription
powerNumberThe power of the scanner.
successCallbackfunctionThe callback function that is called when the connection is established.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope in which the callback function is called.

MobileCRM.Services.ZebraScanner.setVolume Function

Set volume of the Zebra scanner.

Arguments

ArgumentTypeDescription
volumeNumberThe volume of the scanner.
successCallbackfunctionThe callback function that is called when the connection is established.
errorCallbackfunction(errorMsg)The errorCallback which is called in case of error.
scopeObjectThe scope in which the callback function is called.

MobileCRM.Services.Workflow Namespace

Contains objects accessing the Dynamics 365 workflow.

Objects

ObjectDescription
Action[v11.2] Represents custom workfow action.

MobileCRM.Services.Workflow.Action Object

[v11.2] Represents custom workfow action.

Functions

FunctionDescription
execute[v11.2] Asynchronously executes custom workfow action on the server.

MobileCRM.Services.Workflow.Action.execute Function

[v11.2] Asynchronously executes custom workfow action on the server.

Arguments

ArgumentTypeDescription
actionNameStringThe unique name of the custom action to execute.
parametersObjectThe object containing the parameters for the custom action.
successfunction(string)A callback function for successful asynchronous result. The result argument will carry the serialized response from the server.
failedfunction(error)A callback function for command failure. The error argument will carry the error message.
scopeA scope for calling the callbacks; set "null" to call the callbacks in global scope.