How to change the DashboardSettings of maximum controls limit in Dynamics CRM2011/2013

The maximum number of controls allowed on CRM2011 or CRM 2013 dashboards is 6. You cannot put the more than 6 graphs/charts/iframes/web resources etc. on the dashboard.

We can extend the number of controls as per the user needs. This setting is applied to the server not a organization setting. So you cannot change this setting for CRM Online but you can change this for an on-premise installation.

Option 1: Using Window Power Shell we can achieve it.

  1. Open the Windows Power Shell command window
  2. Add the Microsoft Dynamics CRM PowerShell snap-in using

Add-PSSnapin Microsoft.Crm.PowerShell
Sometimes You may get the message saying something like “Add-PSSnapin : Cannot add Windows PowerShell snap-in Microsoft.Crm.PowerShell because it is already added.” It is fine no problem.

3.  Run the following 3 commands

$setting = Get-CrmSetting -SettingType DashboardSettings

$setting.MaximumControlsLimit = 10

Set-CrmSetting -Setting $setting

After that open CRM, still you will be see only 6 components on the dashboard design, however you can add extra components based on how much you have set the limit.

Once you crossed the limit you will get following error message.

DashboardSettings

Option 2: If Powershell does not work, use following C# code to do the same

  public static void UpdateDashboardSettings()
        {
            //Create Instance of Deployment Service
            DeploymentServiceClient service = Microsoft.Xrm.Sdk.Deployment.Proxy.ProxyClientHelper.CreateClient(new Uri("http://CRMServer/Organization/XRMDeployment/2011/Deployment.svc"));
            //Use Default network Credentials(User should de Deployment Admin in Deployment Manager and System Admin in CRM)
            service.ClientCredentials.Windows.ClientCredential = (NetworkCredential)CredentialCache.DefaultCredentials;

            //Retrieve Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq.EntityType = DeploymentEntityType.DashboardSettings;

            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq);
            if (retrieveRes != null && retrieveRes.Entity != null)
            {
                DashboardSettings dsCurrentResult = (DashboardSettings)retrieveRes.Entity;
                if (dsCurrentResult != null)
                    Console.WriteLine("Current DashboardSettings MaximumControlsLimit is " + dsCurrentResult.MaximumControlsLimit);
            }
            //Update Current Dashboard Settings MaximumControlsLimit = 10
            Microsoft.Xrm.Sdk.Deployment.UpdateRequest updateReq = new Microsoft.Xrm.Sdk.Deployment.UpdateRequest();
            DashboardSettings ds = new DashboardSettings();
            ds.MaximumControlsLimit = 10;
            updateReq.Entity = ds;
            Microsoft.Xrm.Sdk.Deployment.UpdateResponse updateRes = (Microsoft.Xrm.Sdk.Deployment.UpdateResponse)service.Execute(updateReq);

            //Retrieve again after updating Current Dashboard Settings MaximumControlsLimit
            Microsoft.Xrm.Sdk.Deployment.RetrieveRequest retrieveReq1 = new Microsoft.Xrm.Sdk.Deployment.RetrieveRequest();
            retrieveReq1.EntityType = DeploymentEntityType.DashboardSettings;
            Microsoft.Xrm.Sdk.Deployment.RetrieveResponse retrieveRes1 = (Microsoft.Xrm.Sdk.Deployment.RetrieveResponse)service.Execute(retrieveReq1);

            if (retrieveRes1 != null && retrieveRes1.Entity != null)
            {
                DashboardSettings dsUpdatedResult = (DashboardSettings)retrieveRes1.Entity;
                if (dsUpdatedResult != null)
                    Console.WriteLine("After Updating DashboardSettings MaximumControlsLimit is " + dsUpdatedResult.MaximumControlsLimit);

            }
        }

NOTE: You need add microsoft.xrm.sdk.deployment DLL from SDK to access those Deployment classes and methods. User who is running this should be Deployment Admin in Deployment Manager and Sys Admin in CRM

Incase if you are getting 404 error while accessing Deployment service, you need to check your CRM web server IIS settings and make sure XRMDeployment is not configured in Hidden Segments in IIS, Follow below steps to remove/add XRMDeployment setting in IIS

  1. Open Internet Information Services(IIS) Manager
  2. Expand Server on left navigation
  3. Expand Sites on the Left Navigation
  4. Click on Microsoft Dynamics CRM
  5. Click on “Request Filtering” icon in IIS on right side window
  6. Click on “Hidden Segments” tab on Request Filtering window on right side
  7. If “XRMDeployment” exists then select “XRMDeployment” and right click on “Remove” and say “Yes” to remove “XRMDeployment” from Hidden Segments
  8. Once you are done executing PowerShell, SDK Code you can add using “Add Hidden Segment” option, enter “XRMDeployment” in Hidden Segment window and click on “OK” to close the window.
Advertisement

Dynamics CRM 2013 SDK version 6.0.4 available

Microsoft Dynamics CRM 2013 latest SDK Version SDK Version 6.0.2 is now available on MSDN download center.

The following table lists the significant changes made to this version of the SDK.

New and updated topics Description of changes
SDK\Bin Updated the assemblies for Microsoft Dynamics CRM 2013 Update Rollup 2. These assemblies are also compatible with the latest service update for Microsoft Dynamics CRM Online.
SDK\Bin\SolutionPackager.exe Fixed the issue where Solution Packager failed to repack solutions that contain entity level business rules.
Authenticate the user with the web services
Walkthrough: Register a CRM app with Active Directory
Sample: Windows 8 desktop modern SOAP app
Sample: Windows 8 desktop modern OData app
Updated the documentation to include use of Active Directory Federation Services (AD FS) 3.0.
Configure email for incoming messages
SampleCode\CS\BusinessDataModel\
BusinessManagement\ConfigureQueueEmail.cs
SampleCode\VB\BusinessDataModel\
BusinessManagement\ConfigureQueueEmail.vb
Documented deprecated and read-only attribute changes for the email user name and password attributes in the Queue and UserSettings entities.

Changed the sample code, removing the lines of code that set the attributes.

Create a custom workflow activity Removed support for Microsoft .NET Framework 4.5. Added the requirement to digitally sign the assembly.
Install or uninstall the Developer Toolkit Added a statement that the Developer Toolkit can’t be installed into the Express edition of Microsoft Visual Studio.
Xrm.Page.ui (client-side reference) The Xrm.Page.ui.getCurrentControl method is deprecated in Microsoft Dynamics CRM 2013 Update Rollup 2.

Microsoft Dynamics CRM 2013 Update Rollup 2 is available

Update Rollup 2 for Microsoft Dynamics CRM 2013 is available.

Check out Microsoft KB article Rollup 2 for Microsoft Dynamics CRM 2013 KB Article

This rollup is available for all languages that are supported by Microsoft Dynamics CRM 2013.

Update Rollup 2 introduces support for the following:

  • Windows 8.1 and Internet Explorer 11 using CRM 2013 web application and CRM for Tablets
  • iOS7 support with Safari on iPad using the web application
  • Support for Safari using web application and CRM for Tablets using the tablet app for iPad Air
  • Windows Server 2012 R2 for CRM Server

Download link for Microsoft Dynamics CRM 2013 Update Rollup2: http://www.microsoft.com/en-us/download/details.aspx?id=42272

Keyboard shortcuts in Dynamics CRM 2013

The following table provides keyboard shortcuts used in Dynamics CRM 2013. The shortcut keys described in this section refer to the U.S. keyboard layout.

To Press
Move to the next option, option group, or field Tab
Move to the previous option, option group, or field Shift+Tab
Complete the command for the active option or button Enter
Move between options in an open list, or between options in a group of options Arrow keys
Cancel a command, or close a selected list or dialog box Esc
Save Ctrl+S or Shift+F12
Save and Close Alt+S
Cancel edits and close (Close) Esc
Open search Spacebar or Enter
Delete text from a field Backspace
Delete the record (when forms are in Edit mode) Ctrl+D
Save and then open a new form (Save and New) (when forms are in Edit mode) Ctrl+Shift+S
Open the lookup menu with the most recently used items in alphabetical order Alt+Down Arrow
Open the list menu (when forms are in Edit mode) Ctrl+Shift+2
Navigate to the next item on the list (when forms are in Edit mode) Ctrl+>
Navigate to the previous item on the list (when forms are in Edit mode) Ctrl+<
Open lookup drop-down list Enter
Close lookup drop-down list Esc
Auto-resolve lookup value Ctrl+K
Open a record found in lookup with forms in Edit mode Enter
Open a record found in lookup with forms in Read-optimized mode Ctrl+Enter
Add a step in the Sales Process Configuration Tool Al+Shift+N
Add a stage in the Sales Process Configuration Tool Alt+Shift+M
Tab to Command Bar when in the updated user experience Ctrl + [
Tab to process control when in the updated user experience Ctrl + ]
Tab to the Navigation pane Ctrl + Shift + 3
Tab to main work area when editing a form in the updated user experience Ctrl + Shift + 1

Tablets and Phones limitations and known issues in Dynamics CRM 2013

This topic describes issues and limitations that may be experienced when you run Microsoft Dynamics CRM 2013 for tablets, when you use a tablet and run Microsoft Dynamics CRM in a web browser, or when you use Microsoft Dynamics CRM for phones.

Tablet and phone limitations:

  • You can’t switch users when you run the CRM for tablets app or the CRM for phones app: The Microsoft Dynamics CRM for Windows 8, Microsoft Dynamics CRM for iPad, and CRM for phones apps can only run under the single user account that was set up when the application was installed. To change a user in the tablet or phone app, uninstall the app and then install the app again to specify the new user.
  • User credentials required for Microsoft Dynamics CRM 2013 (on-premises) mobile apps with AD FS versions earlier than Windows Server 2012 R2: Active Directory Federation Services (AD FS) in Windows Server 2012 R2 supports multi-factor authentication (MFA) that can be configured to let mobile Microsoft Dynamics CRM (on-premises) clients authenticate without prompting for user name and password credentials. Earlier versions of Active Directory Federation Services (AD FS) don’t support MFA and require credentials when a mobile Microsoft Dynamics CRM (on-premises) app client signs in.

Tablet known issues:

  • CRM (on-premises) URL doesn’t resolve on Nexus tablets: When you try to access Microsoft Dynamics CRM (on-premises) using an internal URL on a Nexus 10 tablet in the Chrome web browser, the URL doesn’t resolve and you can’t access the site. For example, a URL in the form of https://servername:5555 doesn’t resolve. This is a known issue with Android devices accessing IIS intranet sites. To work around this issue, select one of the following solutions.
  • CRM for tablets users are repeatedly prompted for sign-in credentials and can’t sign in: Users who try to sign in to Microsoft Dynamics CRM Server 2013 (on-premises) configured for Internet-facing deployment (IFD) using Microsoft Dynamics CRM for tablets are repeatedly prompted for credentials and can’t sign in. This issue occurs when the server running IIS where the CRM web application is installed has Negotiate and NTLM Windows authentication providers enabled on certain CRM website features. To resolve the issue, run a Repair of Microsoft Dynamics CRM Server on the server running IIS where the Web Application Server role is installed. To run this the CRM deployment must already be configured for claims-based authentication and IFD.
  • “Invalid user” error message when you try to sign in on a device that was recently used to sign-in by another user: When a user signs in to Microsoft Dynamics CRM and selects “Save email and password” using the CRM for Windows 8 app, another user may be unable to sign in to CRM using the device after the initial sign-in. This occurs even after the uninstall and reinstall that is required to change users on a tablet. This behavior occurs because the sign-in token must expire before another user can sign in using the same device. To work around this issue, either wait a period of time (48 hours by default) for the sign-in token to expire or sign in from another Windows 8 device.
  • Event 10001 messages appear in the Event Log when you run CRM for Windows 8 : The following event may be recorded multiple times to the Event Log, when ‘Show Analytic and Debug Logs’ is enabled, on the device where Microsoft Dynamics CRM for Windows 8 is running. Notice that, by default, ‘Show Analytic and Debug Logs’ is disabled in Event Viewer and these messages won’t be recorded.
    • Event Id: 10001
    • Message: SEC7131 : Security of a sandboxed iframe is potentially compromised by allowing script and same origin access.

    Verify the source of the messages. If the source is Microsoft Dynamics CRM Server, these events don’t pose a security threat and can be ignored.

Best practices for reports in Dynamics CRM 2013

The following best practices can help you to produce reports that are easier to write, comply with established standards, and execute with improved efficiency.

General best practices: This section provides best practices for creating custom SQL-based and fetch-based reports.

  • Use an existing report to create custom reports: Check whether there is an existing report in Microsoft Dynamics CRM that is close to the design that you are looking for. Download the report definition of the report, and then modify the RDL file instead of creating a new one from scratch. By doing this, you will save development time and reduce report writing errors.
  • Use Microsoft Dynamics CRM formats for currency, number, date and time, calendar: The FilteredUserSettings view contains information about currency format, date and time format, number format, negative number, starting day of the week, calendars, and other formats. Microsoft Dynamics CRM provides the fn_GetFormatStrings database function to obtain the date, time, number, currency, and calendar formats from the FilteredUserSettings view.
  • Set the page size: Reporting Services does not provide explicit page orientation, such as portrait and landscape modes, or preset page sizes. Standard Microsoft Dynamics CRM reports were designed for 8.25 x 11 (portrait) or 11 x 8.25 (landscape) page sizes that work for both US letter and A4 paper.
  • Back up your reports: Make backup copies of your reports and store them on a computer other than the reporting server.
  • Define truncation if needed: Text wrapping is the default behavior for a text box report item in Reporting Services. This means that, unless indicated otherwise, all text will wrap at the defined width of any text area and then grow vertically. If truncation is specified, a text box will truncate text at the width of the text box within the specified padding (default is 2pt left and right.) Any maximum length truncation beyond this will require custom coding. The default Microsoft Dynamics CRM reports are set up with tool tips to show static text or values from data fields when the user hovers the mouse pointer over the report item. If you use truncation, consider setting the ToolTip property to the field value so that the full text will appear when the user hovers over the truncated text.

SQL-based reports: This section provided best practices for SQL-based reports only.

  • Writing stored procedures: Adding custom stored procedures to the Microsoft Dynamics CRM database is not supported. However, you can create a separate database and write stored procedures to that database.
  • Limit text length and number of items in charts: Microsoft Dynamics CRM reports use only some of the possible chart types from Reporting Services.For any chart type, limiting label length and number of items is recommended for the chart contents to be displayed correctly. When Reporting Services displays a chart with long labels, the chart itself becomes too small to be usable. There are several ways to do this:
      • Limit your chart label length explicitly, truncating it if it is necessary.
      • Consider limiting the number of items displayed in charts.
  • Use embedded images in a report: The easiest way to use images with Reporting Services is to put the images into a database. If the images are not in a database, you can use embedded images in .png, .gif, or .jpg formats in a report. The image files that are used by Microsoft Dynamics CRM image files are located in the C:/Inetpub/wwwroot/_imgs/ico folder on a default Microsoft Dynamics CRM installation.

Dynamics CRM 2013 User Interface Integration package is available

Microsoft Dynamics CRM 2013 User Interface Integration package is now available on MSDN download center.

MicrosoftDynamicsCRM2013UII.exe is available as a separate download from the SDK download page. It contains User Interface Integration (UII) solution framework, which includes a deployment guide, development guide and api reference. UII uses Microsoft Dynamics CRM for the delivery of configuration data for the Integrated Agent Desktop. It includes development and run-time components. Applications built with UII can provide unified access to customer information across different systems and can aggregate different modes of customer interactions or channels.

User Interface Integration (UII) for Microsoft Dynamics CRM uses the features of Dynamics CRM to deliver composite applications that share a common user interface. UII includes development and run-time components. Applications built with UII can provide unified access to customer information spread across different systems, and can aggregate different modes of customer interactions or channels. Unlike expensive, rip and replace approaches or risky investments on custom development, UII provides non-intrusive integration with existing systems.

Dynamics CRM 2013 SDK version 6.0.2 available

Microsoft Dynamics CRM 2013 latest SDK Version SDK Version 6.0.2 is now available on MSDN download center.

The following table lists the significant changes made to this version of the SDK.

Topic Description of changes
SDK\Bin Updated the assemblies for Microsoft Dynamics CRM 2013 Update Rollup 1. These assemblies are also compatible with the latest service update for Microsoft Dynamics CRM Online.
Handle exceptions in your code Added information about how to view the details of an exception that are hidden from the user because of insufficient permissions.
Organization entity attributes Added topic listing all the attributes that can be set for an organization.
Sample: Set and retrieve entity images New sample to show how to work with entity images.
Xrm.Page.ui control (client-side reference) Added information about a new parameter in the setNotification and clearNotification methods. The uniqueId parameter allows you to clear a specific notification set on a field, based on the uniqueId value used when the notification was set.
SDK Versions 6.0.3 and 5.0.18 coming this week Adding authentication related documentation and updated sample code to support the transition of Microsoft account subscriptions to Microsoft online services. This applies only to Microsoft Dynamics CRM Online customers.
Actions on entity records Updated metadata information.
Authenticate the user with the web services Added OAuth provider URLs.
Command bar or ribbon presentation Updated the CRM for tablets section to note that icons configured for commands won’t display and labels that are too long will be truncated.
<CrmParameter> (RibbonDiffXml) Changed description of the SelectedControlSelectedItemReferences attribute to fix an error. This option is only available when used with the <JavaScriptFunction> (RibbonDiffXml) element, not the <Url> (RibbonDiffXml) element.
Dialog limitations Added information about nested steps.
Form events (client-side reference) Added a note to the OnLoad Event section saying: Forms for Updated entities don’t reload the page after the initial save creating a record or any subsequent saves. Therefore, the OnLoad event occurs only during the initial load of the form.
Form scripting quick reference Updated this topic to include examples of new form methods.
Lookup information for the post entity and post follow entity Explained how to retrieve lookup information for the RegardingObjectId.Target property for the post entity and post follow entity.
Open forms, views, dialogs and reports with a URL Updated this topic as well as <JavaScriptFunction> (RibbonDiffXml) and <Url> (RibbonDiffXml) to add a note to say that opening entity forms in a dialog window using showModalDialog or showModelessDialog isn’t supported.
In the application, always use Xrm.Utility.openEntityForm instead of window.open to open entity forms.
Model business process flows Updated information about maximum number of activated business process flows per entity. See section: Maximum number of processes, stages, and steps.
<PageRule> (RibbonDiffXml) Added remarks to note that this rule can’t be used in Microsoft Dynamics CRM for tablets because it will always refer to one page.
Sample: Windows 8 desktop modern SOAP app
Sample: Windows 8 desktop modern OData appSampleCode\CS\ModernAndMobileApps
Added new sample applications that show how to write a Windows 8 desktop modern application that can send requests to the organization web service without linking to the SDK assemblies.
Sample: Windows 8 desktop modern SOAP app uses the Windows Azure Active Directory Authentication Library (ADAL) and the SOAP protocol.
Sample: Windows 8 desktop modern OData app uses the ADAL and the OData protocol.
<Url> (RibbonDiffXml) Added a note to this topic saying that it shouldn’t be used to open entity forms. Use <JavaScriptFunction> (RibbonDiffXml) with a function using Xrm.Utility.openEntityForm instead.
Walkthrough: Connect with CRM using Java Walkthroughs\Java2CRM Removed sample code and walkthrough. Now that Microsoft Dynamics CRM Online is transitioning from the legacy billing and administration platform to the Microsoft online services environment, this sample is no longer relevant. For more information about using CRM Online or CRM 2013 IFD with Java or other non-.NET languages, see the blog post: Use OAuth to authenticate with the CRM service.
Walkthrough: Register a CRM app with Active Directory Changed the instructions from using the Windows Azure portal to using Graph Explorer.
Write and debug scripts for CRM for tablets Added new topic to consolidate information related to writing scripts for Microsoft Dynamics CRM for tablets.
Write code for Microsoft Dynamics CRM forms Added a note to the Different Form Presentations section to say that the collaboration control found in updated entity forms isn’t accessible using form scripts. The section containing the control is available if you want to show or hide the section and the control in it.
Write scripts for composite attributes Added information to the Composite attributes in the web application section about the naming convention used to access the individual constituent controls displayed in the flyout for composite controls in the web application.
Xrm.Page.ui control (client-side reference) Updated information in the getAttribute section to note that constituent controls for quick view forms can access the value of an attribute, but any changes to the value of this attribute won’t be saved.

Microsoft Dynamics CRM 2013 Update Rollup 1 is available

Update Rollup 1 for Microsoft Dynamics CRM 2013 is available.

Check out Microsoft KB article Rollup 1 for Microsoft Dynamics CRM 2013 KB Article

Update Rollup 1 for Microsoft Dynamics CRM 2013 is available for on-premises customers. This rollup is available for all languages that are supported by Microsoft Dynamics CRM 2013. Update Rollup 1 contains stability and memory-consumption improvements.

Update Rollup 1 resolves the following issues:

  • Publishing a CRM report fails as the parent report already links to another report with same name.
  • Invalid Argument when navigating to view with related entity lookup.
  • The chart (for any other entity) does not display in Korean due to System.ArgumentException: “Value of ‘Malgun Gothic, Segoe UI, 9.5px’ is not valid for ‘units’.”
  • Script error occurs when moving from a form. “Unable to get property ‘get_filterType’ of undefined or null reference”
  • Disabling checkbox fields using the JavaScript API does not work.
  • Creating a workflow to update an appointment with fields from the regarding Lead field fails. “An unexpected error occurred.”
  • Hiding the last field of a section does not hide the section. Hiding the last field of a tab does not collapse the tab.
  • Unable to create automatic full address field workflows, as the spaces and tabs are removed if there are no other symbols like comma.
  • Using the Quick Search in Outlook and clicking Advanced Find right afterwards, the Advanced Find filter is populated with irrelevant criteria.
  • Re-import of existing solution fails with The label for base language code 1033 is not set.
  • Users cannot associate multiple records at once for N:N relationships.
  • CRM 2013 no longer warns you when you are about to delete a parent record that child records with cascade delete set on their relationships to the parent will also be deleted.
  • Unable to set a web resource to visible in script if ‘Visible by default’ not set in designer.
  • You´ve created a new business process flow and assigned that process flow to the security role of “sales manager”, “system administrator” and “system customizer”. You publish this modification and expect the process the be visible only for these security roles.Instead the BPF is hidden for all users.Instead the BPF is hidden for all users.
  • When data is entered into a form, the Save button can be clicked multiple times which results in multiple of the same record being created.
  • For a custom duration field Xrm.Page.getAttribute(“durationfield”).getValue() method returns a formatted value like30 minutes instead of 30 as expected.
  • When organization is deleted and then immediately imported back, import organization wizard unexpectedly displays a warning about version mismatch.
  • Autosave off: Entity form looses command bar after navigating away and re-opening.
  • Consider you’ve created a Business Process for cases having a related task stage with several steps and you’d like to translate all stages to different language. Your solution contains task and case entity as well as Business Process. You’re exporting translation files and try to edit those. You’ll find all stage names from case entity, but you do not find those of the related task step. Therefore you cannot translate those.
  • “Email a link” URL does not navigate to the specified entity if opened in existing browser tab.
  • Errors occur when using different country formats with currency attributes.
  • When browsing to various locations in CRM, a JavaScript exception is thrown that reports “Object expected”.
  • The .addCustomFilter javascript function does not work properly.
  • Workflow triggered on Before Delete event cannot be imported in a new organization.
  • When email activity with unresolved email recipient is created and saved, on load on email, value in TO field is hidden, field is empty.
  • Not able to see “Page Index” on subgrids from dashboards.
  • Published customization changes do not roll down to mobile client consistently.
  • Opportunity closed as won does not take custom status reason while closing.
  • Notes control shows time but not date for notes created before yesterday.
  • Mobile clients crash with UI Error: “We’re sorry. Sorry, something went wrong while initializing the app. Please try again, or restart the app”
  • Access team does not use correct metadata driven by Advanced Find view and hence fails in Mobile Clients.
  • If you create a new email message in the Microsoft Dynamics CRM 2013 web application, you discover that you cannot modify the Description field when using the latest version of Google Chrome.

JavaScript references in Microsoft Dynamics CRM 2013

The JavaScript object model is the JavaScript API that CRM provides to enable you to customize various behaviors based on events and to access CRM data that is present on a form.

CRM 2013 fully supports the JavaScript object model from the previous version; however, it does not support the JavaScript object model from Microsoft Dynamics CRM 4.0.

Check out following reference documentation for client-side events and object models that can be used with JavaScript libraries. * marked is new in CRM 2013.

Xrm.Utility: Xrm.Utility object provides a container for useful functions not directly related to the current page. The following table lists the functions of Xrm.Utility.

Xrm.Utility
alertDialog Displays   a dialog box with a message.
confirmDialog Displays   a confirmation dialog box that contains a message as well as OK and Cancel   buttons.
isActivityType Determine   if an entity is an activity entity.
openEntityForm Opens   an entity form.
openWebResource Opens   an HTML web resource.

Xrm.Page.data: Xrm.Page.data provides an entity object that provides collections and methods to manage data within the entity form. The following tables lists the functions of Xrm.Page.data and Xrm.Page.data.entity

Xrm.Page.data
getIsValid* Do a validation check for the data in   the form.
refresh* Asynchronously refresh all the data of the form without reloading the page.
save* Saves the record asynchronously with the option to set callback functions.
Xrm.Page.data.entity
addOnSave Adds a function to be called when the record is saved.
getDataXml Returns a string representing the xml that will be sent to the server when the record is saved.
getEntityName Returns a string representing the  logical name of the entity for the record.
getId Returns a string representing the GUID   id value for the record.
getIsDirty Returns a Boolean value that indicates if any fields in the form have been modified.
getPrimaryAttributeValue* Gets a string for the value of the primary attribute of the entity.
removeOnSave Removes a function to be called when the record is saved.
save Saves the record with the options to close or new.

Xrm.Page.context: Xrm.Page.context provides methods to retrieve information specific to an organization, a user, or parameters that were passed to the form in a query string. The following table lists the functions of Xrm.Page.context.

 Xrm.Page.context
client.getClient* Returns a value to indicate which client the script is executing in.
client.getClientState* Returns a value to indicate the state of the client.
getClientUrl Returns the base URL that was used to access the application.
getCurrentTheme Returns a string representing the current Microsoft Office Outlook theme chosen by the user.
getOrgLcid Returns the LCID value that represents   the base language for the organization.
getOrgUniqueName Returns the unique text value of the   organization’s name.
getQueryStringParameters Returns a dictionary object of key   value pairs that represent the query string arguments that were passed to the   page.
getUserId Returns the GUID of the SystemUser.Id value for the current user.
getUserLcid Returns the LCID value that represents the provisioned language that the user selected as their preferred language.
getUserName* Returns the name of the current user.
getUserRoles Returns an array of strings that represent the GUID values of each of the security roles that the user is  associated with.
isOutlookClient (Deprecated) Returns a Boolean value indicating if the user is using Microsoft Dynamics CRM for Outlook.
isOutlookOnline (Deprecated) Returns a Boolean value that indicates whether   the user is connected to the CRM server.
prependOrgName Prepends the organization name to the   specified path.

Xrm.Page.ui:  Xrm.Page.ui provides collections and methods to manage the user interface of the form. The following table lists the functions of Xrm.Page.ui

Xrm.Page.ui
clearFormNotification* Remove form level notifications.
close Method to close the form.
formSelector.getCurrentItem Method to return a reference to the   form currently being shown.
formSelector.items A collection of all the form items accessible to the current user.
getViewPortHeight Method to get the height of the viewport in pixels.
getViewPortWidth Method to get the width of the viewport   in pixels.
getCurrentControl Get the control object that currently has focus.
getFormType Get the form context for the record.
navigation.items A collection of all the navigation items on the page.
setFormNotification* Display form level notifications.
refreshRibbon Re-evaluate the ribbon data that controls what is displayed in it.
 Collections
Xrm.Page.data.entity.attributes All attributes on the page.
Xrm.Page.ui.controls All controls on the page.
Xrm.Page.ui.formSelector.items All the forms available to the user.
Xrm.Page.ui.navigation.items All the items in the form navigation   area.
Xrm.Page.ui.tabs All the tabs on the page.
Xrm.Page Attribute.controls All the controls for the attribute.
Xrm.Page.ui Section.controls All the controls in the section.
Xrm.Page.ui Tab.sections All the sections in the tab.
 Collections Methods
forEach Apply an action in a delegate function to each object in the collection.
get Get one or more object from the collection depending on the arguments passed.
getLength Get the number of items in the collection.

Attributes: Attributes store the data available in the record. Attributes are available from the Xrm.Page.data.entity.attributes collection. To access an attribute you can use the Xrm.Page.data.entity.attributes.get method or the shortcut version Xrm.Page.getAttribute. Following table shows how you can query attribute properties to understand what kind of attribute it is or change the behavior of the attribute.

 Xrm.Page.getAttribute(“…”)
getAttributeType Get the type of attribute.
getFormat Get the attribute format.
getIsDirty Determine whether the value of an   attribute has changed since it was last saved.
getIsPartyList Determine whether a lookup attribute   represents a partylist lookup.
getMaxLength Get the maximum length of string which   an attribute that stores string data can have.
getName Get the name of the attribute.
getParent Get a reference to the Xrm.Page.data.entity object that is the parent to all attributes.
getRequiredLevel Returns a string value indicating   whether a value for the attribute is required or recommended.
getSubmitMode Sets whether data from the attribute   will be submitted when the record is saved. always / never / dirty
getUserPrivilege Determine what privileges a user has   for fields using Field Level Security.
getValue / setValue Gets or Sets the data value for an   attribute.
setRequiredLevel Sets whether data is required or   recommended for the attribute before the record can be saved. none / required  / recommended
setSubmitMode Returns a string indicating when data   from the attribute will be submitted when the record is saved.
Number Attribute Methods
getMax / getMin Returns a number indicating the maximum   or minimum allowed value for an attribute.
getPrecision Returns the number of digits allowed to   the right of the decimal point.
setPrecision* Override the precision set for a number attribute.
DateTime Attribute Methods
setIsAllDay* Specify whether a date control should  set a value including the entire day.
setShowTime* Specify whether a date control should  show the time portion of the date.

Controls: Controls represent the user interface elements in the form. Each attribute in the form will have at least one control associated with it. Not every control is associated with an attribute. IFRAME, web resource, and subgrids are controls that do not have attributes. Controls are available from the Xrm.Page.ui.controls collection. To access a control you can use the Xrm.Page.ui.controls.get method or the shortcut version Xrm.Page.getControl. The following table lists the functions of Controls.

Xrm.Page.getControl(“…”)  
clearNotification* Remove a message already displayed for   a control.
getAttribute Get the attribute that the control is   bound to.
getControlType Get information about the type of   control.
getDisabled / setDisabled Get or Set whether the control is   disabled.
getLabel / setLabel Get or Set the label for the control.
getName Get the name of the control.
getParent Get the section object that the control   is in.
getVisible / setVisible Get or Set a value that indicates   whether the control is currently visible.
setFocus Sets the focus on the control.
setNotification* Display a message near the control to   indicate that data is not valid.

 Lookup Controls: The following table lists the functions of Lookup Control.

addCustomFilter* Use fetchXml to add additional filters   to the results displayed in the lookup. Each filter will be combined with an   ‘AND’ condition.
addCustomView Adds a new view for the lookup dialog   box.
addPreSearch* Use this method to apply changes to   lookups based on values current just as the user is about to view results for   the lookup.
getDefaultView / setDefaultView Get or Set Id value of the default   lookup dialog view.
removePreSearch* Use this method to remove event handler

OptionSet: The following table lists the functions of OptionSet Control.

getInitialValue Returns a value that represents the   value set for an optionset or boolean when the form opened.
getOption[s] Returns an option object with the value   matching the argument passed to the method.
getSelectedOption Returns the option object that is selected.
getText Returns a string value of the text for   the currently selected option for an optionset attribute.
adoption / removeOption Adds or remove an option to an option   set control.
clearOptions Clears all options from an Option Set   control.

IFRAME and Web Resource Controls:  An IFRAME control allows you to include a page within a form by providing a URL. An HTML web resource added to a form is presented using an IFRAME element. Silverlight and image web resources are embedded directly within the page. The following table lists the functions of IFrame or Web Resource controls.

getData / setData Get or Set the value of the data query   string parameter passed to a Silverlight web resource.
getInitialUrl Returns the default URL that an I-frame   control is configured to display. This method is not available for web   resources.
getObject Returns the object in the form that   represents an I-frame or web resource.
getSrc / setSrc Get or Set the current URL being   displayed in an IFrame or web resource.

Sub-Grid Control: Sub-Grid control has refresh method. We can use this method to refresh data displayed in a Sub-Grid.

refresh Refreshes the data displayed in a Sub-Grid.

OnChange Event: There are three methods you can use to work with the OnChange event for an attribute.

addOnChange / removeOnChange Sets or remove a function to be called   when the attribute value is changed.
fireOnChange Causes the OnChange event