MSCRM 2011 Javascript Development Cheat Sheet
MSCRM 2011 Javascript Development Cheat Sheet
MSCRM 2011 Javascript Development Cheat Sheet
Xrm.Page.context Methods
getAuthenticationHeader getCurrentTheme getOrgLcid getOrgUniqueName getQueryStringParameters getServerUrl getUserId getUserLcid getUserRoles isOutlookClient isOutlookOnline prependOrgName Method addOnChange fireOnChange getAttributeType getFormat getInitialValue getIsDirty getMax getMaxLength getMin getName getOption getOptions getParent getPrecision getRequiredLevel getSelectedOption getSubmitMode getText getUserPrivilege getValue removeOnChange setRequiredLevel setSubmitMode setValue Returns the encoded SOAP header for MSCRM 4.0 style Web service calls Returns the current users Outlook theme Returns the LCID value for the base language of the organization Returns the unique organizations name Returns an array of key-value pairs representing the query strings Returns the base server URL Returns the current users SystemUser id Returns the LCID value representing the users preferred language Returns an array of GUID values of the security roles the user is associated with Returns a Boolean value indicating if the user is using Outlook client Returns a Boolean value indicating if the user is connected to the server while using MSCRM for Outlook with Offline Access Prepends the organization name to the specified path Description Sets a function to be called when the value is changed Causes the OnChange event to occur on the attribute Returns the type of attribute (string) Returns formatting options for the attribute (string) Returns the initial value for Boolean or optionset attributes Returns a Boolean value indicating if there are unsaved changes to the attribute value. Returns the maximum allowed value for an attribute (number) Returns the maximum length of an attribute (number) Returns the minimum allowed value for an attribute (number) Returns the logical name of the attribute Returns an option object by matching its name Returns an array of options for an optionset attribute Returns the parent object to the attribute Returns the number of digits allowed after the decimal point Returns a string indicating whether the attribute is required or recommended Returns the option selected in an optionset attribute. Returns a string indicating if the attribute will be submitted when the record is saved Returns the selected option for an optionset attribute Returns an array of Boolean values indicating if the user can create/read/update an attribute's values Retrieves the data value for an attribute Removes a function from the OnChange event handler Sets whether the attribute is required or recommended Sets whether the attributes data will be submitted Sets the data value for an attribute.
Xrm.Page.ui.formSelector members
Member items getCurrentItem forEach get Type Description Collection A collection of all accessible form items Method Returns the form currently being shown.
Silverlight Web resources Lookup All except Web Resources All All IFrame and Web Resource All Sets a value indicating if the control is visible Sets a function to be called when the record is saved Returns the xml string to be sent to the server when the record is saved Returns the logical name of the entity for the record Returns GUID id value for the record Returns a Boolean value indicating if any fields in the form have been modified Removes a function from the OnSave event hander Saves the record Closes the form. Returns the control that currently has focus Indicates the form context for the record Returns the height of the viewport in pixels Returns the width of the viewport in pixels Causes the ribbon to refresh
Xrm.Page.data.entity Methods
Xrm.Page.ui Methods
close getCurrentControl getFormType getViewPortHeight getViewPortWidth refreshRibbon
Form Event Handler Execution Context Reference getContext Returns the Xrm.Page.context object getDepth Returns a value indicating the order in which this handler is executed getEventArgs Returns an object with methods to manage the Save event getEventSource Returns a reference to the object that the event occurred on getSharedVariable Retrieves a variable set using setSharedVariable setSharedVariable Sets the value of a variable to be used by a hander after the current handler completes
Shortcut methods
Shortcut Equivalent Xrm.Page.getAttribute Xrm.Page.data.entity.attributes.get Xrm.Page.getControl Xrm.Page.ui.controls.get GetGlobalContext (Web Resources) Xrm.Page.context (within forms)