Tip #20: Use alertDialog and confirmDialog to display messages to users

If your javascript code is peppered with alerts and confirms, it’s time to stock up on the invigorating drink of your choice and rewrite. The reason is very simple – CRM for tablets does not like anything that blocks execution. New stablemates are alertDialog and confirmDialog – use them to display messages to users and set code to execute based on their response. Because of the asynchronous nature, the signature of the functions is different and involves callbacks:

    Xrm.Utility.alertDialog(message, onCloseCallback)

    Xrm.Utility.confirmDialog(message, yesCloseCallback, noCloseCallback)

Read about pitfalls and see the code sample

Tip #19: How to hide a form

The only way to hide a form in CRM 2011 is to remove all security roles from the form. CRM 2013 adds ability to deactivate the form making it unavailable to all users. As expected, form list command bar now has Activate/Deactivate buttons to toggle the status. The buttons are “dumb”, they recognize neither the current form status nor the fact that only forms of type Main can be deactivated, and opt for the error message instead.

Tip #18: How to disable export from the reports

Sometimes there is a requirement to stop users from being able to export CRM reports. Take away Export to Excel privilege and reports will be displayed without the export button. Dependency on Excel export privilege is, perhaps, a bit unintuitive, and the privilege covers not only Excel but other export formats as well. Privilege is located on the Business Management tab of the security role dialog. If you’ve been following our tips then privilege needs to be taken off the base role only. Otherwise, all roles assigned to the user, as well as all roles assigned to the teams the user is a member of, need to have this privilege taken off.

Tip #17: Search SDK like a pro

One good thing about local copy of the Dynamics CRM SDK documentation is that it restricts the search to the SDK itself. Local copy can be searched without usual distractions of online search like advertisements or third-party posts about SDK. Either 2011 or 2013 version of SDK can be downloaded, then installed and searched locally. Turns out, online search can also be restricted to SDK. Simply open www.crmdevelopercenter.com, click Search SDK and fire away. One thing that you probably noticed is that the search box refers to “Search the Microsoft Dynamics CRM 2011 SDK” – that is correct, online copy of 2013 SDK is coming soon.

While we are at it, in addition to www.crmdevelopercenter.com, there are two other new CRM “centers” online: www.crmitprocenter.com and www.crmcustomercenter.com

Tip #16: Add OnChange events to the Dynamics CRM 2013 Address Control

Microsoft Dynamics CRM 2013 adds a new control for addresses that displays the address inside of a single field. This is fantastic, because it saves a lot of space on the form (compared with separate address fields), and it is consistent with how other applications, like Outlook, handle addresses.

Address control

So what if you have form logic, such as OnChange javascript running on change of your address fields? At first glance, it seems like you can’t add OnChange events to address fields.

Turns out you can add OnChange events to the address fields, by adding all of the address events to the address control. The script will still run on change of the fields, just like it did when you had individual address fields on the form.

Thanks to guest tipster Carsten Groth

Tip #15: Auto refresh CRM dashboard

Some implementations manage fast-paced processes that bring fresh data to CRM every minute (for example, busy call center). Dashboards in these scenarios can be very useful, however they will age very quickly and potentially display obsolete information. While it is probably not an issue for the most end-users who drive CRM interface as part of their jobs, some users, like managers, may find that they need to refresh the display on a regular basis to get up-to-date information. If this is the case, add a small html resource to your dashboard that refreshes the parent dashboard every few minutes. More instructions and the code to do just that

Tip #14: CRM Gustronomy – apply security roles to dashboards

System dashboards in CRM 2011 are visible to all users regardless of their roles and permissions. The only supported way to expose dashboard to a selective group of users is to create a personal dashboard and then share it. CRM 2013 added ability to apply security roles to the dashboards making it much easier to tailor user interface to a specific user role.

Open any solution containing dashboards (Default Solution will do), select Dashboards under Components then select individual dashboard. Click Enable Security Roles button and you’ll be presented with the form security dialog (wording “select the security roles for which this form will be displayed” is a dead giveaway) where you can restrict dashboard to specific user roles.

This tip is from our guest contributor

Tip #13: CRM Gustronomy – how to delete a field

One of my pet annoyances with CRM form editor in 2011 and 2013 has always been inconsistency in field handling. It is so easy to create a new field but impossible to delete one. Or so I thought, until showed me a very clever way to nuke a field. Instructions in a nutshell: remove field from the form, Save, Publish, add field back to the form, click Change Properties, Details tab, Edit button, then Action -> Delete command, Cancel, Cancel, get an error message, dismiss the error message. Voilà.

http://youtu.be/B5R0HRQIo8I

 

Tip #12: Use field descriptions to create tooltips

In all previous versions of CRM field description served no purpose except reminding customizers what the field is about or serving as part of project documentation. CRM 2013 now displays the field description as a tooltip for the field label making it the first port of call to improve form usability and to provide instant help to the end users. HTML is not supported but new lines are honored.

Field description as tooltip

So now is a good time to remove that “Our CEO is an idiot” description – who knows, his mouse just might come to the rest on that label.

This tip is from our guest contributor Lyfe Langmead

Tip #11: Internet Explorer 11 and CRM mobile access

If you are one of the brave individuals who upgraded to Windows 8.1, you may find that Internet Explorer now has a new shiny version number — 11. Or, perhaps, you were game enough to download and install IE 11 for Windows 7. Since CRM 2011 has no clue what IE 11 is, it promptly redirects it to a mobile page, as it does with any unrecognized browsers. To get rich CRM UI we know and love, simply replace /m/default.aspx part of the URL with /main.aspx and then press Enter. And then add the page to favorites.

CRM 2013, on the other hand, happily opens in IE 11 (it still has no clue what IE 11 is but it now applies uniform principle “newer is better” across all browsers). To see how much better mobile interface has become, just do the reverse: replace /main.aspx (and the rest of the URL) with /m (do not add default.aspx, that part has changed). This comes handy when testing mobile forms or demonstrating new and improved mobile functionality. This functionality has been previously known as a mobile express and it has nothing to do with the native mobile apps available for CRM 2013.