1. Interact with the CRM UI
- Modify Fields and Controls
- Show, hide, set and get values
- Save and refresh forms
- Call actions based on form navigation
- Modify the menu bar and navigation actions
- Launch a form that the user has permissions to view
- Launch dialogs
2. Push\Pull Data
- Query and manipulate data from the form
- Query the user’s properties and security permissions
- Query and manipulate data from other entities
- Query and manipulate data external to CRM
3. Interact with Business Process Flows
- With the Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update, the client-side object of Xrm.Page.data.process allows you to interact with business process flows in your scripts
When dealing with the CRM UI, the SDK documents the exposed objects and the properties that are available to interface with. As a general rule, you should adhere to the exposed objects and interact with them via the documented properties and methods using the Xrm.Page object model.
For example, if you were navigating the HTML DOM structure (instead of using the Xrm.Page protocol) and using window.getElementById or even manipulating the innerHTML or outerHTML, an update rollup or a service pack could cause your script to fail. Additionally, the DOM structure can be different from one browser to the next, so using this navigation method introduces risk, while using the documented API of the Xrm.Page object model has no navigation risks. CRM 2015 On-Premises and CRM Online support the following browsers:
- Internet Explorer on Windows
- Firefox on Windows
- Safari on Mac OS X
- Chrome on Windows or Google Nexus 10
Here are some performance items to keep in mind:
1. Limit the number of Script libraries your form references. Performance can lag when you view a form for the first time that has multiple scripts. Starting with CRM 2013, scripts are loaded asynchronously and any onload event will fire as soon as the scripts are all downloaded. Additionally, if your OnChange or OnSave events require certain libraries, do not load them with the OnLoad event because of the perceived performance lag.
2. Remember to collapse all the tabs when you design your forms so that the page can load as fast as possible. All elements inside the sections of the collapsed tabs are not loaded until the tab is opened. There is a TabStateChange event that can invoke your code as needed.
- Set and clear field values
- Set field requirement levels
- Show and hide fields
- Enable and disable fields
- Validate data and show error messages
- In CRM 2015, Business Rules can be defined to run at the entity level instead of strictly at the client UI level. This means that regardless if the user invoked the rule via form navigation, or if a system via integration interacted with the platform, the behavior of the business rule will be adhered to.
If the business rule was defined to run at the entity level, the server will execute the rule after any synchronous plug-ins are executed for the entity.
That’s all for our blog today! You can learn more about Microsoft Dynamics CRM 2015 on our website. If you want more tips and tricks like this one for CRM, make sure you sign up to receive our monthly newsletter so you can stay up-to-date with everything happening in the world of CRM!