Microsoft Dynamics Crm 2013 Client Api Cheat Sheet V1.1

ADVERTISEMENT

Microsoft Dynamics CRM 2013 Client API Cheat Sheet v1.1
Rami Mounla
Xrm.Utility
Xrm.Page.data.entity
Collections Methods
Xrm.Page.getControl("...")
forEach
Apply an action in a delegate function
alertDialog
Displays a dialog box with a message.
addOnSave
Adds a function to be called when the record is saved.
clearNotification
Remove a message already displayed for a control.
to each object in the collection.
confirmDialog
Displays a confirmation dialog box that contains an optional
attributes
The collection of attributes for the entity.
getAttribute
Get the attribute that the control is bound to.
get
Get one or more object from the
message as well as OK and Cancel buttons.
getDataXml
Returns a string representing the xml that will be sent to the
getControlType
Get information about the type of control.
collection depending on the arguments
isActivityType
Determine if an entity is an activity entity.
server when the record is saved.
getDisabled
Returns whether the control is disabled.
passed.
openEntityForm
Opens an entity form.
getEntityName
Returns a string representing the logical name of the entity
getLabel
Returns the label for the control.
getLength
Get the number of items in the
for the record.
openWebResource
Opens an HTML web resource.
getName
Get the name of the control.
collection.
getId
Returns a string representing the GUID id value for the
openWebResourceDialog
Opens an HTML web resource as a dialog. (removed from beta)
getParent
Get the section object that the control is in.
record.
getIsDirty
Returns a Boolean value that indicates if any fields in the
getVisible
Returns a value that indicates whether the control is
Xrm.Page.data
form have been modified.
currently visible.
execObj.getEventArgs().getSaveMode()
getPrimaryAttributeValue
Gets a string for the value of the primary attribute of the
setDisabled
Sets whether the control is disabled.
getIsValid
Do a validation check for the data in the form.
entity.
Save
1
setFocus
Sets the focus on the control.
refresh
Asynchronously refresh all the data of the form without reloading
removeOnSave
Removes a function to be called when the record is saved.
Save and Close
2
setLabel
Sets the label for the control.
the page.
save
Saves the record with the options to close the form or open
save
Saves the record asynchronously with the option to set callback
Deactivate
5
setNotification
Display a message near the control to indicate that
a new form after the save is completed.
functions to be executed after the save operation is completed.
data is not valid.
Reactivate
6
setFormDirty
Set the value to show whether data on the form has been changed
setVisible
Sets a value that indicates whether the control is
Send (Email)
7
since the last save. (removed from beta)
visible.
Disqualify (Lead)
15
Xrm.Page.getAttribute("...")
DateTime
Qualify (Lead)
16
getAttributeType
Get the type of attribute.
setIsAllDay
Specify whether a date control should set a value
Assign (user or team owned entities)
47
Xrm.Page.ui
including the entire day.
getFormat
Get the attribute format.
Save as Completed (Activities)
58
setShowTime
Specify whether a date control should show the time
clearFormNotification
Remove form level notifications.
getIsDirty
Determine whether the value of an attribute has changed since it
portion of the date.
Save and New
59
was last saved.
close
Method to close the form.
Lookup
AutoSave
70
getIsPartyList
Determine whether a lookup attribute represents a partylist
controls
A collection of all the controls on the page.
addCustomFilter
Use fetchXml to add additional filters to the results
lookup.
formSelector.getCurrentItem
Method to return a reference to the form currently being
displayed in the lookup. Each filter will be combined
getMaxLength
Get the maximum length of string which an attribute that stores
shown.
with any previously added filters as an ‘AND’ condition.
string data can have.
formSelector.items
A collection of all the form items accessible to the current
addCustomView
Adds a new view for the lookup dialog box.
getName
Get the name of the attribute.
Xrm.Page.ui.getFormType()
user.
addPreSearch
Use this method to apply changes to lookups based on
Get a reference to the Xrm.Page.data.entity object that is the
getParent
getViewPortHeight
Method to get the height of the viewport in pixels.
Undefined
0
values current just as the user is about to view results
parent to all attributes.
getViewPortWidth
Method to get the width of the viewport in pixels.
for the lookup.
Create
1
getRequiredLevel
Returns a string value indicating whether a value for the attribute
getCurrentControl
Method to get the control object that currently has focus
getDefaultView
Returns the Id value of the default lookup dialog view.
Update
2
is required or recommended.
on the form.
removePreSearch
Use this method to remove event handler functions
Read Only
3
getSubmitMode
Sets whether data from the attribute will be submitted when the
getFormType
Method to get the form context for the record.
that have previously been set for the PreSearch event.
record is saved.
Disabled
4
navigation.items
A collection of all the navigation items on the page.
setDefaultView
Sets the default view for the lookup control dialog.
always / never / dirty
Quick Create
5
OptionSet
setFormNotification
Display form level notifications.
getUserPrivilege
Determine what privileges a user has for fields using Field Level
Bulk Edit
6
Security.
addOption
Adds an option to an option set control.
refreshRibbon
Method to cause the ribbon to re-evaluate data that
Read Optimized
11
getValue
Retrieves the data value for an attribute.
controls what is displayed in it.
clearOptions
Clears all options from an Option Set control.
setRequiredLevel
Sets whether data is required or recommended for the attribute
removeOption
Removes an option from an Option Set control.
Xrm.Page.context
before the record can be saved.
Web Resource or IFrame
none / required / recommended
client.getClient
Returns a value to indicate which client the script is executing
getData
Returns the value of the data query string parameter
setSubmitMode
Returns a string indicating when data from the attribute will be
in.
passed to a Silverlight web resource.
XRM
submitted when the record is saved.
client.getClientState
Returns a value to indicate the state of the client.
getInitialUrl
Returns the default URL that an I-frame control is
setValue
Sets the data value for an attribute.
configured to display. This method is not available for
getClientUrl
Returns the base URL that was used to access the application.
Number
web resources.
getCurrentTheme
Returns a string representing the current Microsoft Office
Page
Utility
getMax
Returns a number indicating the maximum allowed value for an
getObject
Returns the object in the form that represents an I-
Outlook theme chosen by the user.
attribute.
frame or web resource.
getOrgLcid
Returns the LCID value that represents the base language for
getMin
Returns a number indicating the minimum allowed value for an
getSrc
Returns the current URL being displayed in an IFrame
the organization.
attribute.
data
or web resource.
ui
context
getOrgUniqueName
Returns the unique text value of the organization’s name.
getPrecision
Returns the number of digits allowed to the right of the decimal
setData
Sets the value of the data query string parameter
getQueryStringParameters
Returns a dictionary object of key value pairs that represent
point.
passed to a Silverlight web resource.
the query string arguments that were passed to the page.
OnChange Event
setSrc
Sets the URL to be displayed in an IFrame or web
Returns the GUID of the SystemUser.Id value for the
getUserId
entity
Controls
addOnChange
Sets a function to be called when the attribute value is changed.
resource.
current user.
Other Controls
fireOnChange
Causes the OnChange event to occur on the attribute so that any
getUserLcid
Returns the LCID value that represents the provisioned
script associated to that event can execute.
refresh
Refreshes the data displayed in a Sub-Grid.
language that the user selected as their preferred language.
Number
Lookup
removeOnChange
Removes a function from the OnChange event hander for an
setPrecision
Override the precision set for a number attribute.
getUserName
Returns the name of the current user.
Date
attribute.
getUserRoles
Returns an array of strings that represent the GUID values of
OptionSet
each of the security roles that the user is associated with.
getInitialValue
Returns a value that represents the value set for an optionset or
Collections
isOutlookClient
(Deprecated) Returns a Boolean value indicating if the user is
boolean attribute when the form opened.
using Microsoft Dynamics CRM for Microsoft Office Outlook.
Xrm.Page.data.entity.attributes
All attributes on the page.
getOption
Returns an option object with the value matching the argument
isOutlookOnline
(Deprecated) Returns a Boolean value that indicates whether
Xrm.Page.ui.controls
All controls on the page.
passed to the method.
the user is connected to the Microsoft Dynamics CRM server.
getOptions
Returns an option object with the value matching the argument
Xrm.Page.ui.formSelector.items
All the forms available to the user.
prependOrgName
Prepends the organization name to the specified path.
passed to the method.
Xrm.Page.ui.navigation.items
All the items in the form navigation area.
getAuthenticationHeader
removed method.
getSelectedOption
Returns the option object that is selected in an optionset
Xrm.Page.ui.tabs
All the tabs on the page.
getServerUrl
removed method.
attribute.
Xrm.Page Attribute.controls
All the controls for the attribute.
getText
Returns a string value of the text for the currently selected option
Xrm.Page.ui Section.controls
All the controls in the section.
for an optionset attribute.
Xrm.Page.ui Tab.sections
All the sections in the tab.

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go