Tip #634: How to modify recurrent bulk deletion system jobs

On heavy production systems bulk deletion jobs should be scheduled outside of the peak activity window. Unless you’re dealing with 24×7 global monstrosity, scheduling them outside normal working hours would do the trick.

There are handful of system jobs that are created for you when CRM organization is provisioned. You can guess what their start time is going to be – when you provisioned the organization – and that probably will be during the day.

How to modify the start time and, for those feeling extremely adventurous, the recurrence? Just follow instructions in CRM Help & Training Center:

Select the bulk-deletion job, and then on the Actions menu, choose Modify Recurrence

Wait a minute! Where ARE those recurring jobs? All I can see is the list of completed jobs even though I selected All Bulk Deletion System Jobs view?!
All Bulk Deletion System Jobs

All does not mean all in this case, it means “all except those you actually want to see”. Change your view to Recurrent Bulk Deletion System Jobs and now you’ll be able to see the recurrent jobs.
Recurrent Bulk Deletion System Jobs

Now you can follow the instructions from the help center to clean up your mess CRM when nobody’s watching.

Tip #633: What’s to love about the Dynamics Data Loader

Although it has been derided by some as a glorified import utility, Scott “Silverlight Terminator” Durow sees tremendous value in the Azure based Dynamics Data Loader for CRM Online (currently in preview).

Scott says:

I love the fact that you can stage the data without the 32MB file limit and then edit in Excel to correct problems. I also love that you can specify older createdon dates

Tip #631: Azure ML is coming to Dynamics CRM

One of the most exciting upcoming features in CRM Online is Azure Machine Learning integration (under In Preview):

This release will introduce scenario-based Machine Learning (ML) integration with Azure ML for product cross-sell recommendations, and auto-suggest of relevant knowledge articles and case topic analysis. These scenarios are based on integration with Azure ML APIs for recommendations and text analytics. Azure ML integration offers a configuration experience and insights integrated into the CRM user interface. No data scientists required!

Can’t wait!

Azure Machine Learning

Tip #630: No flow – no documents

SetWordTemplate parametersWe did show how to generate documents in code, however, generating documents in a workflow using SetWordTemplate action proved to be just as elusive.

The problem is that the entity itself does not appear in the list of parameters for the action, making it impossible to generate the document.

As strange as it sounds but:

Entity needs to be enabled for the Business process flows to appear in the list of parameters for the SetWordTemplate action.

Thanks to Matt for raising the issue.

Tip #629: If your CRM report comes back empty

We observed this behavior on CRM 2013 SP1 and and CRM 2015 Update 0.2 on-premises. The report runs fine for small ranges (e.g. dates) but, as the range (and number of records to be processed) increases, report comes back blank, as if it didn’t run at all. No errors in CRM, SQL Server or SSRS logs. Both versions, SSRS and fetchxml, choked.

While we were unable to get to the bottom of this behavior, everything points out to the SSRS simply running out of some resources and quietly discarding the report.

To avoid excessive resources consumption:

  • If your report uses aggregates, move whatever aggregates you can to SQL Server. SQL Server will do the job of calculating your SUMs and AVGs better and much faster.
  • Avoid references and formulas involving report cells. Instead of ReportItems!foobar.Value use Fields!foobar.Value where possible. To get correct values from the cells, SSRS needs multiple passes over your report, slowing things down and consuming resources.
  • The above especially true when any grouping is involved. In other words, avoid aggregates over ReportItems like a plague.

Our results of following our own advice:

  • Original report for 3 months – 8 seconds, 12 months – blank.
  • Enhanced report for 3 months – .5 seconds, 12 months – 2 seconds.

Tip #628: Get jQuery the hacker’s way

The official word is:

We do not recommend using jQuery in form scripts and ribbon commands.

Right. And what are we to do with thousands lines of code already relying on that miracle? People insert libraries and keep their fingers crossed or follow the wise ones and encapsulate the instance with jQuery.noConflict() call.

There is an easier way, though. Since CRM uses jQuery itself, you can try doing something as simple as:

if (typeof ($) == 'undefined') {
  if(!!parent) {
    $ = parent.$;
    jQuery = parent.jQuery;
  }
}

Brutal but Works on My CRM™

Note: MSDN warns that “Following Microsoft Dynamics CRM Online 2015 Update 1 … there may not be an instance of jQuery available” but I’m yet to see any evidence of that.

The usual warning: contains small parts, use at your own risk and do not operate boats or heavy machinery.

Tip #627: Smart duplicate detection

Woot-woot! Our video channel now has the official URL: https://www.youtube.com/CRMTipOfTheDay! (Hint: take a minute and subscribe). To celebrate this achievement, our video dude, Derik, has gone MIA. After 38 straight weeks of videos, can’t hold it against him.

So today’s tip is not a video but something that has been on my todo list for quite some time. In fact, the original code spans back to CRM 2011.

DVD RewinderDuplicate detection has always been a pet hate of mine – it’s a cool feature but the interactive dialog has usefulness level of a DVD Rewinder.

But the most annoying part is not even the dialog, it’s the fact that it pops up after all data entry is done, party is over and everyone’s gone home. Imagine frustration of the users who duly enter all contact data including marital status, fax number, blood type and assistance name, only to find out that the contact already exists.

There is a smarter way to do duplicate detection – by making it proactive and real-time. Enter RetrieveDuplicate message – we can send it to the server when attributes change to see if the record is a potential duplicate as user enters the data. How do we know what attributes to monitor? duplicaterule and duplicaterulecondition entities to the rescue, they define the attributes taking part in the active duplicate detection rules.

The solution steps (for CRM2015+):

  1. Download and install the unmanaged solution. Because it’s unmanaged, to remove it, you’d need to nuke by hand the resources it installs (there are only 4 of them)
  2. Create a copy of a contact form – no need to experiment on the good ones.
  3. At the very top, add a section and insert web resource alex_DDNotification.html. Name the control DDNotification.
  4. Add alex_xrmsvctoolkit.0.2.js and alex_duplicatedetection.js scripts to the form.
  5. Add call to AlexDuplicates.OnLoad to the form onload event.
  6. Make sure some duplicate detection rules are activated.
  7. As the form is loaded, code will retrieve duplicate rules from the server and attach onchange handlers to the form fields that are part of the rules.
  8. When any of these fields change, code will send RetrieveDuplicateRequest to the server to get the potential list of duplicates.
  9. If duplicates are found, warning section will be displayed listing the potential duplicates in the web resource area. User can continue as normal but now they are fully aware that record is a potential duplicate.

Smart Duplicate Detection in Action

Since users are now notified well in advance, you can go to Settings > Data Management > Duplicate Detection Settings and switch off duplicate detection on create and update.

This solution has been ported from CRM 2011 so before you pull out pitchforks and apply spießrutenlaufen:

  • It still uses XrmSvcToolkit. Yep, works fine.
  • It still sends custom-grown soap and fetch to the server.
  • It was not aware back then that jQuery on form script is a no-no (separate topic!)
  • Should be rewritten to use web api or at least SDK.Soap.js
  • Should be wrapped up as a single html web resource that combines both code and visualization.
  • Should deploy some timers to cater for fast operators
  • Contains small parts, not suitable for children, does not drive or operates heavy machinery.

BUT you get the idea!

Special thanks go to Oleksandr Klymenko for the initial implementation, and some good ideas and suggestions.

Tip #626: Teach your users to type-ahead

tl;dr

Teach your users how to use keyboard in a lookup control

Longer

I know it’s an old piece of wisdom but this morning I just couldn’t help myself when observing the typical frustrating pattern of a user trying struggling to fill in the lookup field: remove hands from keyboard, grab the mouse, struggle to position the mouse pointer over the magnifying glass button, click, look at the partial list, struggle to position mouse pointer over the scrollbar, scroll, click Look Up More Records, move hands to keyboard, start typing the name to search for, back to mouse, click magnifying glass, ad infinitum… You get the picture.

Do your users a favor and explain some fundamental keyboard operations in a lookup control:

  • Typing a search term in a lookup field and pressing TAB performs the quick search. You can use any of the search fields (e.g. phone number) as well as the * wildcard.
  • If a unique match is found, your job here is done!
    Type ahead in lookup control
  • If more than one record is found, CRM will display an exclamation mark and move to the next field. Just press Shift-TAB (you did know it goes back to the previous field, didn’t you?) and CRM will drop the list of matches. Use up/down arrows to navigate, press SPACEBAR to select.
  • Still not seeing the record? Press and hold down arrow until it hits Look Up More Records, press SPACEBAR. Here is your search dialog in all its glory.
  • If there is a value in the lookup field – press DEL button to clear it or just start typing if you’d like to replace the link.

Tip #625: The death of Activity Feeds has been exaggerated

Dynamics CRM TipperI’ll start today’s truckstop with a rant (which, in itself, is nothing unusual).
<rant>

</rant>

Jukka

New 2016 instances of CRM Online no longer show the custom entities under Settings – Activity Feeds Configuration. In an upgraded org these Post Configuration records are still available, however. Has the feature been deprecated?

The CRM 2016 documentation for Configure Activity Feeds states that custom entities are supported.

For activity feeds, you can enable customizable business entities and custom entities that are user-owned, team-owned or organization-owned. For a list of entities that you can enable for activity feeds, see Microsoft Dynamics CRM web application. On the nav bar, choose Microsoft Dynamics CRM > Settings. click Post Configurations. The Post Configurations area contains a list of entities that are configurable for activity feeds.

It’s not an environment specific issue. I first noticed this when a person posted a questions onto my blog, then I checked a recent customer org that’s been on 2016 from the start. It only has 30 default entities available for Activity Feeds, none of the 30 custom entities I’ve created there show up in the list.

Joel

Here’s what you need to do—on that view there is a refresh list button—not the one at the top but the other one on the list. Click that and then the custom entities will appear.

Tipp Jarr’s 1,000 words

Refresh Activity Feeds