Tip #25: Make bit fields required in Business Process Flows

In the new Business Process Flow functionality in CRM 2013, what if you want to have a bit field that must equal yes before the user can advance to the next process stage? When you add a new bit (two option) field with the default values and make it required, when the record is viewed, the value of the field on the process flow will be set to no, but the user will still be able to move past the stage, because it will appear to CRM to contain a value (even though that value is no).

The answer is to change the options in the bit field to “Complete” and “Mark Complete (instead of “Yes” and “No”). If those values are present and the field is required, the business process flow will require the value to be “Complete” before proceeding.

The answer is that you need to click the “required” box on the process flow step, rather than set the requirement on the field definition in customization. If the field is required in customization, it will need to contain data, but it will treat “No” as a value, and allow the user to proceed to the next step. If the “required” checkbox is checked on the business process flow step, the process flow will not let users proceed to the next step without setting the value to 1 (yes).

Thanks to Adam Vero for helping make this tip correct. Check out his blog at http://blog.crmguru.co.uk/ for some great tips.

Tip #24: Use children to update running workflow

Running workflows always cache the definitions and are unaffected by any future definition changes. This behavior is by design, however, occasionally it’s desirable to have some of the steps to use the latest definitions, e.g. content of the email. Isolating these steps into a separate child workflow effectively allows users to modify properties of a running workflow.

Let’s say you have a requirement to send an appointment reminder to a customer one day before the scheduled service activity is due. Typical implementation would like this:

Service Activity Reminder workflow

The problem is, as soon as the workflow starts (triggered by a service activity record creation), it will be in the waiting state until the time is due. So if you decide to change the email content (to fix a spelling mistake, for example), reminders for the existing appointments will still use the old definition even though the reminders themselves could be in the future.

Solution is to isolate sending email into a child workflow:

Service Activity Reminder with Child workflow

In this implementation, email reminders will always use the latest definitions from the Send reminder workflow because it does not actually run until the time is due.

Tip #23: Swap Customer Addresses

In Microsoft Dynamics CRM, the contact and account entity form display the first two addresses for the customer, and by default, addresses 3 and greater are displayed in the address link on the navigation bar (AKA more addresses).

Consider this scenario: you are a wealth management company, and some of your clients are retired “snowbirds” that spend the winter in Florida and the spring and summer in the north. How can you make it easy to swap addresses so another address appears as address 1 part of the year?

  1.  Edit the Address entity “Associated” view. Remove the filter that makes this view only show addresses greater than Address 2. This will now make the navbar link for addresses display all addresses, including the addresses on the form.filter
  2. Add the Address Number field the Address form.
  3. Now you can go to a customer record, click on the address NavBar link, open the addresses, and manually update the address numbers. I recommend updating 1 to a higher number, then updating the address you wish to be address 1 to address number 1.

Address swaps can also be automated using workflow or other processes.

Tip #22: Install Dynamics CRM with precreated database

In some enterprises, database administrators wish to have greater control over the database creation process for CRM installations. This can be for security reasons, naming databases a certain structure, or controlling how the database files are structured. The CRM implementation guide does not include a pre-created database option, but it is possible to do in a supported way.

  1. In a development or non-production environment, create a new CRM organization.  It does not matter what you name it.
  2. Back up the organization (*_MSCRM) database
  3. Restore to your production SQL server with the desired name (be sure it ends in “_MSCRM”)
  4. Install Microsoft Dynamics CRM server. When you reach the screen that asks what roles to install, instead of installing full server, uncheck one of the roles (like a minor one, like help server). If you don’t install all the roles, the organization will not be created during the installation. You can come back and install this role when you are finished.
  5. When the installation is complete, launch the deployment manager and import the organization from the backup you restored in step 3.

Tip #21: Don’t work too hard

Happy Thanksgiving

To all our American friends, acquaintances, regular listeners and accidental visitors we wish Happy Thanksgiving.

Don’t work too hard and remember to spend time with your loved ones.

Our professional harvest this year includes formidable CRM 2013, let the next year see this game changer thriving and taking over the world.

CRM Tipsters

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