Included Snippets

Jason Lattimer edited this page Jan 9, 2017 · 10 revisions
Clone this wiki locally

XrmAttributeAddOnChange: 5.0+ Sets a function to be called when the attribute value is changed.

Xrm.Page.getAttribute("${fieldname}").addOnChange(${functionName})

XrmAttributeFireOnChange: 5.0+ Causes the OnChange event to occur on the attribute so that any script associated to that event can execute.

Xrm.Page.getAttribute("${fieldname}").fireOnChange()

XrmAttributeGetName: 5.0+ Returns a string representing the logical name of the attribute.

Xrm.Page.getAttribute("${fieldname}").getName()

XrmAttributeGetAttributeType: 5.0+ Returns a string value that represents the type of attribute.

Xrm.Page.getAttribute("${fieldname}").getAttributeType()

XrmAttributeGetFormat: 5.0+ Returns a string value that represents formatting options for the attribute.

Xrm.Page.getAttribute("${fieldname}").getFormat()

XrmAttributeGetInitialValue: 5.0+ Returns a value that represents the value set for an OptionSet or Boolean attribute when the form opened.

Xrm.Page.getAttribute("${fieldname}").getInitialValue()

XrmAttributeGetIsDirty: 5.0+ Returns a Boolean value indicating if there are unsaved changes to the attribute value.

Xrm.Page.getAttribute("${fieldname}").getIsDirty()

XrmAttributeGetIsPartyList: 6.0+ Returns a Boolean value indicating whether the lookup represents a partylist lookup. Partylist lookups allow for multiple records to be set, such as the To: field for an email entity record.

Xrm.Page.getAttribute("${fieldname}").getIsPartyList()

XrmAttributeGetMax: 5.0+ Returns a number indicating the maximum allowed value for an attribute.

Xrm.Page.getAttribute("${fieldname}").getMax()

XrmAttributeGetMaxLength: 5.0+ Returns a number indicating the maximum length of a string or memo attribute.

Xrm.Page.getAttribute("${fieldname}").getMaxLength()

XrmAttributeGetMin: 5.0+ Returns a number indicating the minimum allowed value for an attribute.

Xrm.Page.getAttribute("${fieldname}").getMin()

XrmAttributeGetOption: 5.0+ Returns an option object with the value matching the argument passed to the method.

Xrm.Page.getAttribute("${fieldname}").getOption(${value})

XrmAttributeGetOptions: 5.0+ Returns an array of option objects representing the valid options for an optionset attribute.

Xrm.Page.getAttribute("${fieldname}").getOptions()

XrmAttributeGetParent: 5.0+ Returns the Xrm.Page.data.entity object that is the parent to all attributes.

Xrm.Page.getAttribute("${fieldname}").getParent()

XrmAttributeGetPrecision: 5.0+ Returns the number of digits allowed to the right of the decimal point.

Xrm.Page.getAttribute("${fieldname}").getPrecision()

XrmAttributeGetRequiredLevel: 5.0+ Returns a string value indicating whether a value for the attribute is required or recommended.

Xrm.Page.getAttribute("${fieldname}").getRequiredLevel()

XrmAttributeGetSelectedOption: 5.0+ Returns the option object that is selected in an optionset attribute.

Xrm.Page.getAttribute("${fieldname}").getSelectedOption()

XrmAttributeGetSubmitMode: 5.0+ Returns a string indicating when data from the attribute will be submitted when the record is saved.

Xrm.Page.getAttribute("${fieldname}").getSubmitMode()

XrmAttributeGetText: 5.0+ Returns a string value of the text for the currently selected option for an optionset attribute.

Xrm.Page.getAttribute("${fieldname}").getText()

XrmAttributeGetUserPrivilege: 5.0+ Returns an object with three Boolean properties corresponding to privileges indicating if the user can create, read or update data values for an attribute.

Xrm.Page.getAttribute("${fieldname}").getUserPrivilege()

XrmAttributeGetValue: 5.0+ Retrieves the data value for an attribute.

Xrm.Page.getAttribute("${fieldname}").getValue()

XrmAttributeRemoveOnChange: 5.0+ Removes a function from the OnChange event hander for an attribute.

Xrm.Page.getAttribute("${fieldname}").removeOnChange(${functionName})

XrmAttributeSetRequiredLevel: 5.0+ Sets whether data is required or recommended for the attribute before the record can be saved.

Xrm.Page.getAttribute("${fieldname}").setRequiredLevel("${none|required|recommended}")

XrmAttributeSetSubmitMode: 5.0+ Sets whether data from the attribute will be submitted when the record is saved.

Xrm.Page.getAttribute("${fieldname}").setSubmitMode(\"${always|never|dirty}\")

XrmAttributeSetValue: 5.0+ Sets the data value for an attribute.

Xrm.Page.getAttribute("${fieldname}").setValue("${value}")

XrmProcessAddOnStageChange: 7.0+ Use these methods to add or remove event handlers for the business process flow control.

Xrm.Page.data.process.addOnStageChange(${functionName})

XrmProcessAddOnStageSelected: 7.0+ Use this to add a function as an event handler for the OnStageSelected event so that it will be called when a business process flow stage is selected.

Xrm.Page.data.process.addOnStageSelected(${functionName})

XrmProcessGetActivePath: 7.0+ Use this method to get a collection of stages currently in the active path with methods to interact with the stages displayed in the business process flow control.

Xrm.Page.data.process.getActivePath()

XrmProcessGetActiveProcess: 7.0+ Returns a Process object representing the active process.

Xrm.Page.data.process.getActiveProcess()

XrmProcessGetActiveStage: 7.0+ Use getActiveStage to retrieve information about the active stage and setActiveStage to set a different stage as the active stage.

Xrm.Page.data.process.getActiveStage()

XrmProcessGetDisplayState: 7.1+ Retrieve the display state for the business process control.

Xrm.Page.ui.process.getDisplayState()

XrmProcessGetEnabledProcesses: 7.0+ Use this method to asynchronously retrieve the enabled business process flows that the user can switch to for an entity.

Xrm.Page.data.process.getEnabledProcesses(${callbackfunctionName}(enabledProcesses))

XrmProcessGetSelectedStage: 7.1+ Use this method to get the currently selected stage.

Xrm.Page.data.process.getSelectedStage()

XrmProcessGetVisible: 7.1+ Retrieve whether the business process control is visible.

Xrm.Page.ui.process.getVisible()

XrmProcessMoveNext: 7.0+ Progresses to the next stage.

Xrm.Page.data.process.moveNext(${callbackfunctionName})

XrmProcessMovePrevious: 7.0+ Moves to the previous stage. Use movePrevious to a previous stage in a different entity.

Xrm.Page.data.process.movePrevious(${callbackfunctionName})

XrmProcessRemoveOnStageChange: 7.0+ Use this to remove a function as an event handler for the OnStageChange event.

Xrm.Page.data.process.removeOnStageChange(${functionName})

XrmProcessRemoveOnStageSelected: 7.0+ Use this to remove a function as an event handler for the OnStageSelected event.

Xrm.Page.data.process.removeOnStageSelected(${functionName})

XrmProcessSetActiveProcess: 7.0+ Set a Process as the active process.

Xrm.Page.data.process.setActiveProcess("${processId}", ${callbackfunctionName})

XrmProcessSetActiveStage: 7.0+ Set a completed stage as the active stage.

Xrm.Page.data.process.setActiveStage("${stageId}", ${callbackfunctionName})

XrmProcessSetDisplayState: 7.0+ Use this method to expand or collapse the business process flow control.

Xrm.Page.ui.process.setDisplayState("${expanded|collapsed}")

70+ XrmProcessSetVisible: Use this method to show or hide the business process flow control.

Xrm.Page.ui.process.setVisible(${true|false})

XrmEntityAttributesForEach: 5.0+ Apply an action in a delegate function to each object in the collection of attributes.

Xrm.Page.data.entity.attributes.forEach(function (control, index) {
    ${functionbody}
})

XrmControlsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of controls.

Xrm.Page.ui.controls.forEach(function (control, index) {
    ${functionbody}
})

XrmFormSelectorItemsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of forms.

Xrm.Page.ui.formSelector.items.forEach(function (control, index) {
    ${functionbody}
})

XrmNavigationItemsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of navigation items.

Xrm.Page.ui.navigation.items.forEach(function (control, index) {
    ${functionbody}
})

XrmTabsSectionsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of sections.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.forEach(function (control, index) {
    ${functionbody}
})

XrmTabsSectionsControlsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of controls in a section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).controls.forEach(function (control, index) {
    ${functionbody}
})

XrmTabsForEach: 5.0+ Apply an action in a delegate function to each object in the collection of tabs.

Xrm.Page.ui.tabs.forEach(function (control, index) {
    ${functionbody}
})

XrmEntityAttributes: 5.0+ A collection of all the attributes on the page.

Xrm.Page.data.entity.attributes.get()

XrmEntityAttributesGetLength: 5.0+ Get the number of items in the collection of attributes.

Xrm.Page.data.entity.attributes.getLength()

XrmControls: 5.0+ A collection of all the controls on the page.

Xrm.Page.ui.controls.get()

XrmControlsGetLength: 5.0+ Get the number of items in the collection of controls.

Xrm.Page.ui.controls.getLength()

XrmFormSelectorItems: 5.0+ A collection of all the forms on the page.

Xrm.Page.ui.formSelector.items.get()

XrmFormSelectorItemsGetLength: 5.0+ Get the number of items in the collection of forms.

Xrm.Page.ui.formSelector.items.getLength()

XrmNavigationItems: 5.0+ A collection of all the navigation items on the page.

Xrm.Page.ui.navigation.items.get()

XrmNavigationItemsGetLength: 5.0+ Get the number of items in the collection of navigation items.

Xrm.Page.ui.navigation.items.getLength()

XrmTabsSectionsControls: 5.0+ A collection of all the controls in the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).controls.get()

XrmTabsSections: 5.0+ A collection of all the sections in a tab.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get()

XrmTabsSectionsGetLength: 5.0+ Get the number of items in the collection of sections.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.getLength()

XrmTabs: 5.0+ A collection of all the tabs on the page.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex})

XrmTabsGetLength: 5.0+ Get the number of items in the collection of tabs.

Xrm.Page.ui.tabs.getLength()

XrmContextClientGetClient: 6.0+ Returns a value to indicate which client the script is executing in.

Xrm.Page.context.client.getClient()

XrmContextClientGetClientState: 6.0+ Returns a value to indicate the state of the client.

Xrm.Page.context.client.getClientState()

XrmContextGetClientUrl: 5.0+ Returns the base URL that was used to access the application.

Xrm.Page.context.getClientUrl()

XrmContextGetCurrentTheme: 5.0+ Returns a string representing the current Microsoft Office Outlook theme chosen by the user.

Xrm.Page.context.getCurrentTheme()

XrmContextClientGetFormFactor: 7.1+ Use this method to get information about the kind of device the user is using.

Xrm.Page.context.client.getFormFactor()

XrmContextGetIsAutoSaveEnabled: 7.0+ Returns whether Autosave is enabled for the organization.

Xrm.Page.context.getIsAutoSaveEnabled()

XrmContextGetOrgLcid: 5.0+ Returns the LCID value that represents the language pack that is the base language for the organization.

Xrm.Page.context.getOrgLcid()

XrmContextGetOrgUniqueName: 5.0+ Returns the unique text value of the organization’s name.

Xrm.Page.context.getOrgUniqueName()

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

Xrm.Page.context.getQueryStringParameters()

XrmContextGetTimeZoneOffsetMinutes: 7.1+ Returns the difference between the local time and Coordinated Universal Time (UTC).

Xrm.Page.context.getTimeZoneOffsetMinutes()

XrmContextGetUserId: 5.0+ Returns the GUID of the SystemUser.Id value for the current user.

Xrm.Page.context.getUserId()

XrmContextGetUserLcid: 5.0+ Returns the LCID value that represents the language pack that is the user selected as their preferred language.

Xrm.Page.context.getUserLcid()

XrmContextGetUserName: 6.0+ Returns the name of the current user.

Xrm.Page.context.getUserName()

XrmContextGetUserRoles: 5.0+ Returns an array of strings that represent the GUID values of each of the security roles that the user is associated with and any teams that the user is associated with.

Xrm.Page.context.getUserRoles()

XrmContextIsOutlookClient: 5.0-6.1 Returns a Boolean value indicating if the user is using CRM for Outlook.

Xrm.Page.context.isOutlookClient()

XrmContextIsOutlookOnline: 5.0-6.1 Returns a Boolean value that indicates whether the user is connected to the server while using CRM for Outlook with Offline Access. When this function returns false, the user is working offline without a connection to the server.

Xrm.Page.context.isOutlookOnline()

XrmContextPrependOrgName: 5.0+ Prepends the organization name to the specified path.

Xrm.Page.context.prependOrgName("${path}")

XrmControlsAddCustomFilter: 6.0+ Use to add filters to the results displayed in the lookup. Each filter will be combined with any previously added filters as an 'AND' condition.

var entityName = "account";
var filter = "<filter type='and'><condition attribute='name' operator='eq' value='test' /></filter>";

Xrm.Page.getControl("${fieldname}").addCustomFilter(filter, entityName);

XrmControlsAddCustomView: 5.0+ Adds a new view for the lookup dialog box.

var viewId = "F0EE06F5-BB78-465F-BADA-FC3F5CF05300";
var entityName = "account";
var viewDisplayName = "Custom View";
var fetchXml = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>" +
    "<entity name='account'>" +
    "<attribute name='name' />" +
    "<attribute name='accountid' />" +
    "<filter type='and'>" +
    "<condition attribute='name' operator='eq' value='test' />" +
    "</filter>" +
    "</entity>" +
    "</fetch>\";

var layoutXml = "<grid name='resultset' object='1' jump='accountid' select='1' icon='1' preview='1'>" +
    "<row name='result' id='accountid'>" +
    "<cell name='name' width='150' />" +
    "</row>" +
    "</grid>";
var isDefault = true;

Xrm.Page.getControl("${fieldname}").addCustomView(viewId, entityName, viewDisplayName, fetchXml, layoutXml, isDefault);

XrmControlsAddOnKeyPress: 8.0+ Use this to add a function as an event handler for the keypress event so that the function is called when you type a character in the specific text or number field.

Xrm.Page.getControl("${controlname}").addOnKeyPress(${functionName})

XrmControlsAddOption: 5.0+ Adds an option to an option set control.

Xrm.Page.getControl("${fieldname}").addOption(${option}, ${index})

XrmControlsAddPreSearch: 6.0+ Use this method to apply changes to lookups based on values current just as the user is about to view results for the lookup.

Xrm.Page.getControl("${fieldname}").addPreSearch(${functionName})

XrmControlsClearNotification: 6.0+ Remove a message already displayed for a control.

Xrm.Page.getControl("${controlname}").clearNotification("${uniqueId}")

XrmControlsClearOptions: 5.0+ Clears all options from an option set control.

Xrm.Page.getControl("${fieldname}").clearOptions()

XrmControlsFireOnKeyPress: 8.0+ Use this to manually fire an event handler that you created for a specific text or number field to be executed on the keypress event.

Xrm.Page.getControl("${controlname}").fireOnKeyPress()

XrmControlsGetAttribute: 5.0+ Returns the attribute that the control is bound to.

Xrm.Page.getControl("${controlname}").getAttribute()

XrmControlsGetControlType: 5.0+ Returns a value that categorizes controls.

Xrm.Page.getControl("${controlname}").getControlType()

XrmControlsGetData: 5.0+ Returns the value of the data query string parameter passed to a Silverlight web resource.

Xrm.Page.getControl("${controlname}").getData()

XrmControlsGetDefaultView: 5.0+ Returns the Id value of the default lookup dialog view.

Xrm.Page.getControl("${fieldname}").getDefaultView()

XrmControlsGetDisabled: 5.0+ Returns whether the control is disabled.

Xrm.Page.getControl("${controlname}").getDisabled()

XrmControlsGetInitialUrl: 5.0+ Returns the default URL that an IFRAME control is configured to display. This method is not available for web resources.

Xrm.Page.getControl("${controlname}").getInitialUrl()

XrmControlsGetLabel: 5.0+ Returns the label for the control.

Xrm.Page.getControl("${controlname}").getLabel()

XrmControlsGetName: 5.0+ Returns the name assigned to the control.

Xrm.Page.getControl("${controlname}").getName()

XrmControlsGetObject: 5.0+ Returns the object in the form that represents an IFRAME or web resource.

Xrm.Page.getControl("${controlname}").getObject()

XrmControlsGetParent: 5.0+ Returns a reference to the section object that contains the control.

Xrm.Page.getControl("${controlname}").getParent()

XrmControlsGetShowTime: 7.1+ Get whether a date control shows the time portion of the date.

Xrm.Page.getControl("${fieldname}").getShowTime()

XrmControlsGetSrc: 5.0+ Returns the current URL being displayed in an IFRAME or web resource.

Xrm.Page.getControl("${controlname}").getSrc()

XrmControlsGetVisible: 5.0+ Returns a value that indicates whether the control is currently visible.

Xrm.Page.getControl("${controlname}").getVisible()

XrmControlsHideAutoComplete: 8.0+ Use this function to hide the auto-completion drop-down list you configured for a specific text field.

Xrm.Page.getControl("${controlname}").hideAutoComplete()

XrmControlsRemoveOnKeyPress: 8.0+ Use this to remove an event handler for a text or number field that you added using addOnKeyPress.

Xrm.Page.getControl("${controlname}").removeOnKeyPress(${functionName})

XrmControlsRemoveOption: 5.0+ Removes an option from an option set control.

Xrm.Page.getControl("${fieldname}").removeOption(${number})

XrmControlsRemovePreSearch: 6.0+ Use this method to remove event handler functions that have previously been set for the PreSearch event.

Xrm.Page.getControl("${fieldname}").removePreSearch(${functionName})

XrmControlsSetData: 5.0+ Sets the value of the data query string parameter passed to a Silverlight web resource.

Xrm.Page.getControl("${controlname}").setData(value)

XrmControlsSetDefaultView: 5.0+ Sets the default view for the lookup control dialog.

Xrm.Page.getControl("${fieldname}").setDefaultView("${viewId}")

XrmControlsSetDisabled: 5.0+ Sets whether the control is disabled.

Xrm.Page.getControl("${controlname}").setDisabled(${true|false})

XrmControlsSetFocus: 5.0+ Sets the focus on the control.

Xrm.Page.getControl("${controlname}").setFocus()

XrmControlsSetLabel: 5.0+ Sets the label for the control.

Xrm.Page.getControl("${fieldname}").setLabel(\"${value}\")

XrmControlsSetNotification: 6.0+ Display a message near the control to indicate that data isn’t valid.

Xrm.Page.getControl("${controlname}").setNotification("${message}", "${uniqueId}")

XrmControlsSetShowTime: 6.0+ Specify whether a date control should show the time portion of the date.

Xrm.Page.getControl("${fieldname}").setShowTime(${true|false})

XrmControlsSetSrc: 5.0+ Sets the URL to be displayed in an IFRAME or web resource.

Xrm.Page.getControl("${controlname}").setSrc(\"${value}\")

XrmControlsSetVisible: 5.0+ Sets a value that indicates whether the control is visible.

Xrm.Page.getControl("${controlname}").setVisible(${true|false})

XrmControlsShowAutoComplete: 8.0+ Use this to show up to 10 matching strings in a drop-down list as users press keys to type character in a specific text field. You can also add a custom command with an icon at the bottom of the drop-down list.

Xrm.Page.getControl("${controlname}").showAutoComplete(${object})

XrmEntityAddOnSave: 5.0+ Sets a function to be called when the record is saved.

Xrm.Page.data.entity.addOnSave(${functionName})

XrmEntityGetDataXml: 5.0+ Returns a string representing the XML that will be sent to the server when the record is saved. Only data in fields that have changed are set to the server.

Xrm.Page.data.entity.getDataXml()

XrmEntityGetEntityName: 5.0+ Returns a string representing the logical name of the entity for the record.

Xrm.Page.data.entity.getEntityName()

XrmEntityGetId: 5.0+ Returns a string representing the GUID id value for the record.

Xrm.Page.data.entity.getId()

XrmEntityGetIsDirty: 5.0+ Returns a Boolean value that indicates if any fields in the form have been modified.

Xrm.Page.data.entity.getIsDirty()

XrmEntityGetPrimaryAttributeValue: 6.0+ Gets a string for the value of the primary attribute of the entity.

Xrm.Page.data.entity.getPrimaryAttributeValue()

XrmEntityRemoveOnSave: 5.0+ Removes a function to be called when the record is saved.

Xrm.Page.data.entity.removeOnSave(${functionName})

XrmEntitySave: 5.0+ Saves the record synchronously with the options to close the form or open a new form after the save is completed.

Xrm.Page.data.entity.save(${null|"saveandclose"|"saveandnew"})

XrmFormSelectorItemsGetId: 5.0+ Returns the GUID ID of the form.

Xrm.Page.ui.formSelector.items.get("${formindex}").getId()

XrmFormSelectorItemsGetLabel: 5.0+ Returns the label of the form.

Xrm.Page.ui.formSelector.items.get("${formindex}").getLabel()

XrmFormSelectorItemsNavigate: 5.0+ Opens the specified form.

Xrm.Page.ui.formSelector.items.get("${formindex}").navigate()

XrmControlsAddOnPostSearch: 8.1+ Use this method to add an event handler to the PostSearch event.

Xrm.Page.getControl("${controlname}").addOnPostSearch(${functionName})

XrmControlsAddOnResultOpened: 7.1+ Use this method to add an event handler to the OnResultOpened event.

Xrm.Page.getControl("${controlname}").addOnResultOpened(${functionName})

XrmControlsAddOnSelection: 7.1+ Use this method to add an event handler to the OnSelection event.

Xrm.Page.getControl("${controlname}").addOnSelection(${functionName})

XrmControlsGetSearchQuery: 7.1+ Use this method to get the text used as the search criteria for the knowledge base management control.

Xrm.Page.getControl("${controlname}").getSearchQuery()

XrmControlsGetSelectedResult: 7.1+ Use this method to get the currently selected result of the search control. The currently selected result also represents the result that is currently open.

Xrm.Page.getControl("${controlname}").getSelectedResult()

XrmControlsGetTotalResultCount: 8.1+ Gets the count of results found in the search control.

Xrm.Page.getControl("${controlname}").getTotalResultCount()

XrmControlsOpenSearchResult: 8.1+ Opens a search result in the search control by specifying the result number.

Xrm.Page.getControl("${controlname}").openSearchResult(${index}, "${Inline|Popout}")

XrmControlsRemoveOnPostSearch: 8.1+ Use this method to remove an event handler from the PostSearch event.

Xrm.Page.getControl("${controlname}").removeOnPostSearch(${functionName})

XrmControlsRemoveOnResultOpened: 7.1+ Use this method to remove an event handler from the OnResultOpened event.

Xrm.Page.getControl("${controlname}").removeOnResultOpened(${functionName})

XrmControlsRemoveOnSelection: 7.1+ Use this method to remove an event handler from the OnSelection event.

Xrm.Page.getControl("${controlname}").removeOnSelection(${functionName})

XrmControlsSetSearchQuery: 7.1+ Use this method to set the text used as the search criteria for the knowledge base management control.

Xrm.Page.getControl("${controlname}").setSearchQuery(\"${value}\")

XrmNavigationItemsGetId: 5.0+ Returns the name of the item.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).getId()

XrmNavigationItemsGetLabel: 5.0+ Returns the label for the item.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).getLabel()

XrmNavigationItemsGetVisible: 5.0+ Returns a value that indicates whether the item is currently visible.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).getVisible()

XrmNavigationItemsSetFocus: 5.0+ Sets the focus on the item.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).setFocus()

XrmNavigationItemsSetLabel: 5.0+ Sets the label for the item.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).setLabel("${value}")

XrmNavigationItemsSetVisible: 5.0+ Sets a value that indicates whether the item is visible.

Xrm.Page.ui.navigation.items.get(${navigationindex|"navigationname"}).setVisible(${true|false})

XrmProcessGetId: 7.0+ Returns the unique identifier of the process.

Xrm.Page.data.process.getActiveProcess().getId()

XrmProcessGetName: 7.0+ Returns the name of the process.

Xrm.Page.data.process.getActiveProcess().getName()

XrmProcessGetStages: 7.0+ Returns an collection of stages in the process.

Xrm.Page.data.process.getActiveProcess().getStages()

XrmProcessIsRendered: 7.0+ Returns true if the process is rendered, false if not.

Xrm.Page.data.process.getActiveProcess().isRendered()

XrmExecObjGetEventArgs()GetSaveMode: 5.0+ Returns a value indicating how the save event was initiated by the user.

execObj.getEventArgs().getSaveMode()

XrmExecObjGetEventArgs()IsDefaultPrevented: 5.0+ Returns a value indicating whether the save event has been canceled because the preventDefault method was used in this event handler or a previous event handler.

execObj.getEventArgs().isDefaultPrevented()

XrmExecObjGetEventArgs()PreventDefault: 5.0+ Cancels the save operation, but all remaining handlers for the event will still be executed.

execObj.getEventArgs().preventDefault()

XrmExecObjGetContext: 5.0+ Returns the Xrm.Page.context object.

execObj.getContext()

XrmExecObjGetDepth: 5.0+ Returns a value that indicates the order in which this handler is executed.

execObj.getDepth()

XrmExecObjGetEventSource: 5.0+ Returns a reference to the object that the event occurred on.

execObj.getEventSource()

XrmExecObjGetSharedVariable: 5.0+ Retrieves a variable set using setSharedVariable.

execObj.getSharedVariable("${key}")

XrmExecObjSetSharedVariable: 5.0+ Sets the value of a variable to be used by a handler after the current handler completes.

execObj.setSharedVariable("${key}", ${value})

XrmTabsSectionsGetLabel: 5.0+ Returns the label for the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).getLabel()

XrmTabsSectionsGetName: 5.0+ Method to return the name of the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).getName()

XrmTabsSectionsGetParent: 5.0+ Method to return the tab containing the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).getParent()

XrmTabsSectionsGetVisible: 5.0+ Returns true if the section is visible, otherwise returns false.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).getVisible()

XrmTabsSectionsSetLabel: 5.0+ Sets the label for the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).setLabel("${value}")

XrmTabsSectionsSetVisible: 5.0+ Sets a value to show or hide the section.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).sections.get(${null|"sectionname"|sectionindex}).setVisible(${true|false})

XrmProcessGetStagesGetCategoryGetValue: 7.0+ Returns an object with a getValue method which will return the integer value of the business process flow category.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getCategory().getValue()

XrmProcessGetStagesGetCategoryGetValueGetEntityName: 7.0+ Returns the logical name of the entity associated with the stage.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getEntityName()

XrmProcessGetStagesGetId: 7.0+ Returns the unique identifier of the stage.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getId()

XrmProcessGetStagesGetName: 7.0+ Returns the name of the stage.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getName()

XrmProcessGetStagesGetStatus: 7.0+ Returns the status of the stage.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getStatus()

XrmProcessGetStagesGetSteps: 7.0+ Returns the status of the stage.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getSteps()

XrmProcessGetStagesGetStepsGetAttribute: 7.0+ Returns the logical name of the attribute associated to the step.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getSteps().get(${stepindex}).getAttribute()

XrmProcessGetStagesGetStepsGetAttributeGetName: 7.0+ Returns the name of the step.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getSteps().get(${stepindex}).getName()

XrmProcessGetStagesGetStepsGetAttributeIsRequired: 7.0+ Returns whether the step is required in the business process flow.

Xrm.Page.data.process.getActiveProcess().getStages().get(${stageindex}).getSteps().get(${stepindex}).isRequired()

XrmControlsAddOnLoad: 7.1+ Use this method to add event handlers to the GridControlOnLoad event.

Xrm.Page.getControl("${controlname}").addOnLoad(${functionName})

XrmControlsGetGrid: 7.1+ Use this method to get access to the Grid available in the GridControl.

Xrm.Page.getControl("${controlname}").getGrid()

XrmControlsGetControl: 7.1+ Returns the grid or knowledge base search control.

Xrm.Page.getControl("${controlname}")

XrmControlsGetViewSelectorGetCurrentView: 7.1+ Use this method to get a reference to the current view.

Xrm.Page.getControl("${controlname}").getViewSelector().getCurrentView()

XrmControlsGetEntityName: 7.1+ Use this method to get the logical name of the entity data displayed in the grid.

Xrm.Page.getControl("${controlname}").getEntityName()

XrmGridGetRowsGetData: 7.1+ Returns the GridRowData for the GridRow.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData()

XrmGridGetRowsGetEntity: 7.1+ Returns the GridEntity for the GridRowData.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData().getEntity()

XrmGridGetRowsGetEntityGetEntityGetId: 7.1+ Returns the id for the record in the row.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData().getEntity().getId()

XrmGridGetRowsGetEntityGetEntityName: 7.1+ Returns the logical name for the record in the row.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData().getEntity().getEntityName()

XrmGridGetRowsGetEntityGetPrimaryAttributeValue: 7.1+ Returns the primary attribute value for the record in the row.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData().getEntity().getPrimaryAttributeValue()

XrmGridGetRowsGetEntityGetEntityReference: 7.1+ Returns the entity reference for the record in the row.

Xrm.Page.getControl("${controlname}").getGrid().getRows().get(${rowindex}).getData().getEntity().getEntityReference()

XrmGridGetRows: 7.1+ Returns a collection of every GridRow in the Grid.

Xrm.Page.getControl("${controlname}").getGrid().getRows()

XrmGridGetSelectedRows: 7.1+ Returns a collection of every selected GridRow in the Grid.

Xrm.Page.getControl("${controlname}").getGrid().getSelectedRows()

XrmGridGetTotalRecordCount: 7.1+ Returns the total number of records that match the filter criteria of the view, not limited by the number visible in a single page.

Xrm.Page.getControl("${controlname}").getGrid().getTotalRecordCount()

XrmControlsGetViewSelector: 7.1+ Use this method to get access to the ViewSelector available for the GridControl.

Xrm.Page.getControl("${controlname}").getViewSelector()

XrmControlsGetViewSelectorIsVisible: 7.1+ Use this method to determine whether the view selector is visible.

Xrm.Page.getControl("${controlname}").getViewSelector().isVisible()

XrmControlsRefresh: 5.0+ Refreshes the data displayed in a subgrid.

Xrm.Page.getControl("${controlname}").refresh()

XrmControlsRemoveOnLoad: 7.1+ Use this method to remove event handlers from the GridControlOnLoad event.

Xrm.Page.getControl("${controlname}").removeOnLoad(${functionName})

XrmControlsGetViewSelectorSetCurrentView: 7.1+ Use this method to set the current view.

var contactSavedQuery = {
    entityType: 1039, // SavedQuery
    id: "3A282DA1-5D90-E011-95AE-00155D9CFA02",
    name: "Contacts Saved Query"
}

Xrm.Page.getControl("${controlname}").getViewSelector().setCurrentView(contactSavedQuery);

XrmTabsGetDisplayState: 5.0+ Returns a value that indicates whether the tab is collapsed or expanded.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).getDisplayState()

XrmTabsGetLabel: 5.0+ Returns the tab label.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).getLabel()

XrmTabsGetName: 5.0+ Returns the name of the tab.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).getName()

XrmTabsGetParent: 5.0+ Returns the Xrm.Page.ui (client-side reference) object.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).getParent()

XrmTabsGetVisible: 5.0+ Returns a value that indicates whether the tab is visible.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).getVisible()

XrmTabsSetDisplayState: 5.0+ Sets the tab to be collapsed or expanded.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).setDisplayState("${expanded|collapsed}")

XrmTabsSetFocus: 5.0+ Sets the focus on the tab.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).setFocus()

XrmTabsSetLabel: 5.0+ Sets the label for the tab.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).setLabel("${value}")

XrmTabsSetVisible: 5.0+ Sets a value that indicates whether the control is visible.

Xrm.Page.ui.tabs.get(${null|"tabname"|tabindex}).setVisible(${true|false})

XrmUiClearFormNotification: 6.0+ Use this method to remove form level notifications.

Xrm.Page.ui.clearFormNotification("${uniqueId}")

XrmUiGetCurrentControl: 5.0+ Method to get the control object that currently has focus on the form. Web Resource and IFRAME controls are not returned by this method.

Xrm.Page.ui.getCurrentControl()

XrmUiClose: 5.0+ Method to close the form.

Xrm.Page.ui.close()

XrmUiGetFormType: 5.0+ Method to get the form context for the record.

Xrm.Page.ui.getFormType()

XrmUiGetViewPortWidth: 5.0+ Method to get the width of the viewport in pixels.

Xrm.Page.ui.getViewPortWidth()

XrmUiGetViewPortHeight: 5.0+ Method to get the height of the viewport in pixels.

Xrm.Page.ui.getViewPortHeight()

XrmUiRefreshRibbon: 5.0+ Method to cause the ribbon to re-evaluate data that controls what is displayed in it.

Xrm.Page.ui.refreshRibbon()

XrmUiSetFormNotification: 6.0+ Use this method to display form level notifications.

Xrm.Page.ui.setFormNotification("${message}", "${ERROR|WARNING|INFO}", "${uniqueId}")

XrmUtilityAlertDialog: 6.0+ Displays a dialog box containing an application-defined message.

Xrm.Utility.alertDialog("${message}", ${functionName})

XrmUtilityConfirmDialog: 6.0+ Displays a confirmation dialog box that contains an optional message as well as OK and Cancel buttons.

Xrm.Utility.confirmDialog("${message}", ${yesfunctionName}, ${nofunctionName})

XrmUtilityIsActivityType: 6.0+ Determine if an entity is an activity entity.

Xrm.Utility.isActivityType("${entityName}")

XrmUtilityOpenEntityForm: 5.0+ Opens an entity form.

var name = "account";
var id = "5D24B2A7-957A-4D08-8723-2CEF5219FFA0";
var parameters = {};
parameters["formid"] = "b053a39a-041a-4356-acef-ddf00182762b";
parameters["name"] = "Test";
var windowOptions = {
    openInNewWindow: true
};

Xrm.Utility.openEntityForm(name, id, parameters, windowOptions);

XrmUtilityOpenQuickCreate: 7.1+ Opens a new quick create form.

var entityName = "account";
var createFromEntity = { entityType: "account", id: Xrm.Page.data.entity.getId() };
var parameters = {};
parameters["name"] = "Test";

Xrm.Utility.openQuickCreate(entityName, createFromEntity, parameters).then(${successFunction}, ${errorFunction});

XrmUtilityOpenWebResource: 5.0+ Opens an HTML web resource.

var webResourceName = "new_webResource.htm";
var webResourceData = encodeURIComponent("first=First Value&second=Second Value");
var parameters = {};",  "var width = 300;
var height = 300;

Xrm.Utility.openWebResource(webResourceName, webResourceData, width, height);

XrmMobileIsOfflineEnabled: 8.2+ Returns whether an entity is offline enabled.

Xrm.Mobile.offline.isOfflineEnabled("${entityName}")

XrmMobileCreateOfflineRecord: 8.2+ Creates an entity record in Dynamics 365 mobile clients while working in the offline mode.

var entity = {};
var entity.name = "test"

Xrm.Mobile.offline.createRecord("${entityName}", entity).then(${[successFunction]}, ${[errorFunction]});

XrmMobileRetrieveOfflineRecord: 8.2+ Retrieves an entity record in Dynamics 365 mobile clients while working in the offline mode.

var options = "?$select=name&$expand=primarycontactid($select=contactid,fullname)";"

Xrm.Mobile.offline.retrieveRecord("${entityName}", "${id}", options).then(${[successFunction]}, ${[errorFunction]});

XrmMobileRetrieveMultipleOfflineRecords: 8.2+ Retrieves a collection of entity records in Dynamics 365 mobile clients while working in the offline mode.

var options = "?$select=name&$expand=primarycontactid($select=contactid,fullname)";
var maxPageSize = 100;

Xrm.Mobile.offline.retrieveMultipleRecords("${entityName}", options, maxPageSize).then(${[successFunction]}, ${[errorFunction]});

XrmMobileUpdateOfflineRecord: 8.2+ Updates an entity record in Dynamics 365 mobile clients while working in the offline mode.

var entity = {};
var entity.name = "test"

Xrm.Mobile.offline.updateRecord("${entityName}", "${id}", entity).then(${[successFunction]}, ${[errorFunction]});

XrmMobileDeleteOfflineRecord: 8.2+ Deletes an entity record in Dynamics 365 mobile clients while working in the offline mode.

var entity = {};
var entity.name = "test"

Xrm.Mobile.offline.deleteRecord("${entityName}", "${id}").then(${[successFunction]}, ${[errorFunction]});

XrmControlAddNotification: 8.2+ Displays an error or recommendation notification for a control, and lets you specify actions to execute based on the notification.

var actionCollection = {
    message: "${message}",
    actions: null
};

actionCollection.actions = [function () {
    ${functionbody}
}];

Xrm.Page.getControl("${fieldname}").addNotification({
     messages: ["${message}"],
     notificationLevel: "${RECOMMENDATION|ERROR}",
     uniqueId: "${uniqueId}",
     actions: [actionCollection]
});

XrmUtilityGetBarcodeValue: 8.2+ Returns the barcode information, such as a product number, scanned using the device camera.

Xrm.Utility.getBarcodeValue().then(${[successFunction]}, ${[errorFunction]})

XrmUtilityGetCurrentPosition: 8.2+ Returns the current location using the device geolocation capability.

Xrm.Utility.getCurrentPosition().then(${[successFunction]}, ${[errorFunction]})

XrmPanelLoadPanel: 8.2+ Displays the web page represented by a URL in the static area in the side pane, which appears on all pages in the Dynamics 365 web client.

Xrm.Panel.LoadPanel("${url}", "${title}")

XrmExecObjGetFormContext: 8.2+ Method that returns a reference to either the form (Xrm.Page) or editable grid depending on where the method was called.

execObj.getFormContext()

XrmProcessGetProcessInstances: 8.2+ Returns all the process instances for the entity record that the calling user has access to.

Xrm.Page.data.process.getProcessInstances(${callbackfunctionName}(${object}))

XrmProcessSetActiveProcessInstance: 8.2+ Sets a process instance as the active instance.

Xrm.Page.data.process.setActiveProcessInstance("${processInstanceId}", ${callbackfunctionName})

XrmProcessAddOnProcessStatusChange: 8.2+ Use this to add a function as an event handler for the OnProcessStatusChange event event so that it will be called when the business process flow status changes.

Xrm.Page.data.process.addOnProcessStatusChange(${functionName})

XrmProcessRemoveOnProcessStatusChange: 8.2+ Use this to remove a function as an event handler for the OnProcessStatusChange event event.

Xrm.Page.data.process.removeOnProcessStatusChange(${functionName})

XrmProcessGetInstanceId: 8.2+ Returns the unique identifier of the process instance.

Xrm.Page.data.process.getInstanceId()

XrmProcessGetInstanceName: 8.2+ Returns the name of the process instance.

Xrm.Page.data.process.getInstanceName()

XrmProcessGetStatus: 8.2+ Returns the current status of the process instance.

Xrm.Page.data.process.getStatus()

XrmProcessSetStatus: 8.2+ Sets the current status of the active process instance.

Xrm.Page.data.process.setStatus(\"${status}\", ${callbackFunction})

XrmUiQuickFormControls: 8.1+ A collection of all quick view controls on a form.

Xrm.Page.ui.quickForms

XrmUiQuickFormControlsForEach: 8.1+ Apply an action in a delegate function to each object in the collection of quick view controls on a form.

Xrm.Page.ui.quickForms.forEach(function (qvcontrol, index) {
    ${functionbody}
})

XrmUiQuickFormGetControl: 8.1+ Gets the constituent controls in a quick view control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getControl("${controlname}")

XrmUiQuickFormGetControlType: 8.1+ Returns a string value that categorizes quick view controls.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getControlType()

XrmUiQuickFormGetName: 8.1+ Returns the name assigned to the quick view control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getName()

XrmUiQuickFormGetParent: 8.1+ Returns a reference to the section object that contains the control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getParent()

XrmUiQuickFormGetVisible: 8.1+ Returns a value that indicates whether the quick view control is currently visible.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getVisible()

XrmUiQuickFormGetLabel: 8.1+ Returns the label for the quick view control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").getLabel()

XrmUiQuickFormSetLabel: 8.1+ Sets the label for the quick view control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").setLabel("${value}")

XrmUiQuickFormIsLoaded: 8.1+ Returns whether the data binding for the constituent controls in a quick view control is complete.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").isLoaded()

XrmUiQuickFormRefresh: 8.1+ Refreshes the data displayed in a quick view control.

Xrm.Page.ui.quickForms.get("${qvcontrolname}").refresh()