Tip #369: Booklovers rejoice

To paraphrase Django Unchained:

What is the point of having a website page that speaks CRM books if you can’t wheel ’em out when you have a CRM book-loving guest?

So, without further ado, a small plug about not so small book where all surviving tipsters left their mark.

2013 CRM Field Guide released – almost 1,000 pages of MVP knowledge!

CRM Field GuideBrought to you by the same team you’ve already learned from in CRM 2013 QuickStart, CRM Mobile Survival Guide and more. As always we bring you internationally recognized CRM experts, all of our authors are current Dynamics CRM MVPs.

The 2013 CRM Field Guide is being released only as an electronic book. There is not a print copy available at this time (and all the surviving trees say thank you).

The CRM Field Guide offers best practices, tips and tricks, step-by-step learning and more. The targeted CRM is CRM 2013, however, much of the content continues forward as you move ahead to CRM 2015 and beyond.

Go to the site, www.crmfieldguide.com, check out the content and, if you like what you see, buy a copy or two. There is a lot of man- and woman- hours went into that book, there is good stuff for everyone.

Tip #368: Keep your early bound classes lean

The convenience of early bound classes often overshadows the side-effects of using those. It is, indeed, very easy to write:

CrmSvcUtil.exe /url:https://myorg.api.crm.dynamics.com/XRMServices/2011/Organization.svc
/out:GeneratedCode.cs /username:"myname@live.com" /password:"myp@ssword!"

then add generated file to the project and use syntax-checked
a.accountname = "Acme Inc" instead of a["acountname"] = "Acme Inc"
(see what I’ve done here to demonstrate the usefulness of early-bound classes?)

This approach is acceptable if you are writing a Windows app or a command line utiltiy, less desirable if you are working on a portal code and is definitely a Spießrutenlaufen-generating behavior if your responsibility is a plugin. Why? Because the line above will generate over 6MB in raw C# code which will compile to something like 2.8MB assembly. This size maybe OK for a utility or even a web site but dragging all this code into a plugin assembly is definitely not a good idea, especially if you only need a handful of entities (which is usually the case for the plugins).

CRM SDK does provide some paltry information how to control generation process but Eric Pool did the legwork on your behalf 4 years ago. Just follow the article and save both time and megabytes.

The end result? If you only ever need an account entity, restricting class generation to that entity only generates nice and tidy 77KB source file which compiles into a puny 45KB assembly. Now that we can load into a plugin!

The story is almost identical for Windows Phone development where keeping your app size in check is even more critical. On this occasion the CRM team stepped up and produced a ready-to-use project. Of course, mobile development is not only about the size trimming but that’s a story for another day.

Tip #367: New update naming convention

There recently have been some changes to the terminology surrounding CRM updates, update rollups, and service packs. Long term the new naming/numbering scheme will probably be more consistent than saying “CRM 2013 SP1 UR2,” But it may confuse people used to the traditional names.

Update Rollup 1 has just been released for CRM 2015, but it is not called “Update Rollup 1.” It is called “Update .01.”

Since we can’t improve on the way others have explained it, here are the best links on the topics:

The CRM Team Blog has the official announcement of the new naming conventions.

The CRM in the Field Blog also discusses it, and has a great podcast you can download that explains what is new in the new release.

This download page is where you can get Update .01 for CRM server, client, and other pieces.

Tip #366: Updating full name on existing contact records

If you update the name format in CRM system settings, new records created will have the new full name format, but what about existing records?

Screenshot 2015-04-13 21.04.41

The format of the full name will not be updated on existing contacts automatically. To change the format on existing contact records, update something about the name on the existing records. For example, you can use a workflow or an SSIS job to update the first or last name fields with the existing data. After this, the full name will be updated on the existing records.

 

Tip #365: Date field options in CRM Online 2015 Update 1

Welcome to Tip 365. We finally have enough tips to fill a non-leap year page-a-day calendar.

In yesterday’s tip about the release preview guide for the spring release, we mentioned that date only fields were coming. Here is more details about this fantastic feature.

Screenshot 2015-04-13 14.16.07

Update 1 adds a “Behavior” field that determines how the date acts. There are three options:

  • User Local — the way it acts now, where date/time is rendered in the time zone of the viewing user.
  • Date only — as it says, date only, 1/1/2016 is 1/1/2016 in all time zones.
  • Time-zone independent — this is when you want to have a date/time field that is independent of time zones but still have the time. Think reservation systems, where you want it to say 3 PM no matter who is looking at it

So what happens with the system birthdate field? It is now a date only field.

 

Tip #363: Select target version for CRM Online update

CRM Online 2015 Update 1 will be released shortly. if your organization is upgraded to 2015 after Update 1 is released, will you get 2015 or 2015 U1?

It depends on what updates you approve. When Update 1 becomes available, you can go directly to 2015 Update 1 without approving the 2015 update. This article from Microsoft describes the process in the “Approach 1” section. In a nutshell, you can approve the 2015 update for your non production update, then go to U1 in the sandbox organization to test, then just approve the Update 1 for production and go directly to U1 in Prod.

This approach allows you to only update production one time, rather than going through two updates.

Tip #362: Script errors when testing updates

Sometimes when testing updates to customization, users will get script errors that don’t show up when you were developing them. If this happens, don’t freak out. The following steps frequently will make the errors go away.

  1. Clear the user’s browser cache and restart the browser. Frequently users of CRM have cached pages in Internet Explorer, and clearing the cache will make things work correctly.
  2. If the errors still persist, verify if any other users with the same role/business unit assignments are getting the error. If they are, verify that the user’s security role has adequate permissions for the entity creating the issue.
  3. If the user is the only one experiencing the issue and clearing the browser cache didn’t work, reset the browser to default settings. In Internet Explorer, go Internet Options and click the Advanced tab. Click the reset button.

Screenshot 2015-04-08 14.17.40

And if the user is using CRM 2015 on IE 8 or 9, remember that these browsers are no longer supported. This doesn’t mean that they won’t work, but there is a good chance that users of these browsers will see more error messages than a supported modern browser. Also, all versions of IE before IE 11 (including IE 10) will be out of Microsoft support in January.

 

Tip #361: Use an Exchange Distribution List for CRM email notifications

When it comes to workflow design, one of my least favorite things to see in a workflow is a notification set to go to a specific person. Sure you need it sometimes, but there are some definite downsides. If someone gets promoted or leaves the company, you have to update you customization to change the notification email to send to the replacement. Also, if additional people need to see the notification, you have to add them to the workflow.

One alternate approach that works well is to use an Exchange email distribution list. Create a DL and then add a contact (or some other email enabled entity record) to CRM with the email address of the DL. Then specify the contact in the “To” like of the workflow send email step. Benefits of this approach:

  • You can have the notification go to multiple people.
  • You can have someone who is not a CRM System Administrator manage the notification recipients.
  • You can change the recipients of the notification without having to modify your customization

Tip #360: Workflows on change of process flow stage

In CRM 2013 or 2015, if you have a workflow that runs on change of the process flow stage, such as a notification email, you may occasionally see the workflow fire multiple times.

The reason for this is because the way that the stage is moved by hitting the next/previous buttons makes it very easy for users to click the arrow too many times, and they may accidentally go forward/back too many stages, causing the workflow to double/triple fire. Also, each time the stage is moved, it saves, so if the user advances the stage 4 times, the workflow will run 4 times.

There are several approaches that you can use to guard against this. The following approach uses out of the box tools.

  1. Create a field called notification date.
  2. Add a step at the end of the workflow to update the notification date field with the execution time of the workflow.
  3. Add a check condition step at the beginning of the workflow to check and see if the execution date is less than 5 minutes after notification date. If it is, stop the workflow.

Screenshot 2015-04-06 17.05.33