Tip #679: Multiple CTI matches in Unified Service Desk

Too many search resultsWe have already talked about dealing with multiple search results coming from entity searches in Unified Service Desk.

Results of CTI Search are just as easy to handle – they are very similar, however, there is one crucial difference. Generated as a result of a phone call (or a chat, or a sip call, etc), CTI search can be invoked at any time. If it was performed in the global session, it could overwrite results of any entity search executed previously (say, by a user). To avoid this accidental overwrites, CTI search results are only available in the new session:
Multiple CTI search results

As long as new session is created, identical code can be used:

protected override void DoAction(
      RequestActionEventArgs args)
{
  if (args.Action.Equals("DealWithMultipleResults", 
               StringComparison.OrdinalIgnoreCase))
  {
      var results = GetDesktopRecord().EntityResults;
      // results are List<Entity>, deal with it
      // e.g. bind it to the grid and pop the window 
      // in the FloatingPanel
  }
}

What if you don’t want to process multiple search results, don’t want to create a new session but simply are after CTI replacement parameters like ani or dnis? These parameters are available in the global session but not as documented [[cti.ani]] or [[cti.dnis]]. Simply use [[ani]] or [[dnis]], i.e. drop cti prefix and you’re good to go.

Tip #678: Tipster guide to agreements in Dynamics CRM Field Services

BrexitIn this video, we look at how to set up and define agreements in Dynamics CRM Field Services. When agreements are created you have the ability to have the application auto generate the bookings and work orders.

YouTube player

Give us your feedback, all of it: good, bad, and ugly, I’m sure we can take it. Suggest new topics either in comments or by sending your ideas to jar@crmtipoftheday.com.

Happy new financial year, everyone, and don’t forget to subscribe to http://youtube.com/crmtipoftheday.

Tip #677: Don’t give users and teams the same role

Consider this scenario:

You create a base role that you assign to your users that contains business unit read access to core entities, and assign this role to all of your users. Good idea! You must have read tip 2.

You then decide to give the same role to a few teams, because the teams could also own some records, and your base role contains the permissions that they need. You then add the user with the base role to the team with the same base role.

The problem is, when a user and team have the exact same security role, unpredictable results can occur. On multiple situations, I have seen the user not see the records owned by the team when he or she has the same security role as the team has.

Solution: create a copy of the base role called “Team base role” and assign this role to the teams.

 

Tip #676: Keep your pants on and timestamps intact

Illusion of integrityLet’s say you have a field that requires complex calculations that are impossible to express as a calculated field. For example, the requirement could be to figure out the “real” full name for a contact taking into account the country, ethnicity, contact’s preferences, their royal title, and a phase of the moon.

The first reaction is to write a real-time workflow or, failing to express complexity declaratively, a plugin. So far so good, except one tiny detail. Every time you do that, you’d need an update to the customer record, changing modified on. Some customers, unfortunately, rely on modified on value to perform reporting magic. And that would be fine as long as the input values have indeed changed, e.g. contact acquired a new title or got married. But let’s say, the algorithm has been improved and you need to perform bulk recalculation of the full names. In this case timestamps will change and customer will get understandably angry.

The solution is to “hang off” a separate entity on the side, pretend that it is one-to-one with the contact entity and update a field on that sibling entity with the magically calculated value. Since there is a relationship in place, it’s easy to include this value in the views, reports and, using quick view forms, on the contact form as well. Timestamps will change but only on these calculated entries and not on the contact entity.
Like a boss meme
Illusion of integrity achieved.

Tip #675: Missing custom KPIs

Gentelmen Service Level AgreementService Level Agreements are now available on custom entities as of CRM Online 2016 Update 1 and CRM 2016 Service Pack 1 (on-premises). Even better, you can add custom KPIs to your SLA Items to monitor some additional parameters (datetime only, unfortunately, but I guess it’s due to the fact that time does not go back so your KPIs can be “crossed” only once).

To define custom KPI you only need to add a relationship between your entity and SLA KPI Instance. Easy said, easy done. There is a catch though. Your custom KPI will not appear in the list:
Select custom KPI
until you set the relationship as searchable.
Searchable Relationship

Ugh. If this post saves you 30 minutes I spent hunting down the reason, I’m happy.

Tip #674: Dealing with multiple search results in Unified Service Desk

Too many search resultsUnified Service Desk has a concept of Entity Search, that allows you to store parameterized fetchxml and reuse this definition declaratively (say, in Windows Navigation Rules), or via DoSearch action of the Global Manager, or directly from your code.

One aspect that Entity Search does not deal well with is the searches returning multiple results. USD captures the first result only, indicates the total count in the $Return parameter and sets flag that more results are available. Documentation deflects to the “custom hosted controls”.

Dealing with multiple results is surprisingly simple. USD surfaces only the first result but captures all of them, and information is readily available.

protected override void DoAction(
      RequestActionEventArgs args)
{
  if (args.Action.Equals("DealWithMultipleResults", 
               StringComparison.OrdinalIgnoreCase))
  {
      var results = GetDesktopRecord().EntityResults;
      // results are List<Entity>, deal with it
      // e.g. bind it to the grid and pop the window 
      // in the FloatingPanel
  }
}

Tip #673: Tipster guide to incident types in Dynamics CRM Field Services

Types of injuries at workWe are back after a fortnight with another installment on Field Services. In this video we look at how you can define incident type that can be used to generate specific items for work orders in Dynamics CRM Field Services. We also explain how to work with Service Tasks.

YouTube player

Give us your feedback, all of it: good, bad, and ugly, I’m sure we can take it. Suggest new topics either in comments or by sending your ideas to jar@crmtipoftheday.com.

And don’t forget to subscribe to http://youtube.com/crmtipoftheday

Tip #672: You may be an enterprise

Fake enterpriseIf you are in the business of Dynamics CRM, especially CRM Online, it’s worth from time to time look up the latest Microsoft Dynamics CRM Online pricing and licensing guide. Goal posts move as does the food derived from milk by coagulation of the milk protein casein.

CRM licensing team listens to the feedback from the field and customers alike, and continuously reviews and updates the guide. And so should you (review, that is, not update). For example, in February 2016 muggles (a.k.a users not in posession of Enterprise USL) were not allowed to publish Knowledgebase Articles (yes, those new shiny ones). That has changed in May 2016 edition and the difference between Enterprise and Professional USL (in CRM, that is, ignoring other products) seems to be the ability to create & publish Voice of the Customer Surveys (professional users can still email them and view the results though as long as there is at least one Enterprise USL).

Tip #671: Azure AD is your best friend even if you are on premises

Use backdoorYour CRM deployment is on premises, as is the rest of your IT infrastructure and services, and your bosses cannot be persuaded to consider Office 365, CRM Online or Windows Azure even for a second.

That means you know the pain of discovering that some of the on-premises services, like AD FS, are lagging behind in their capabilities. For example, AD FS 3.0 (Windows Server 2012) does not support OpenID Connect, OAuth password authentication for confidential clients (aka web sites), to name a few. And if you ever tried to configure multi-factor authentication, you know the real pain.

One of the scenarios you may want to consider: while maintaining your preccccious infrastructure, provision Azure AD and federate it with your on-premises domain. The result? Magically, you now have support for OpenID Connect (so you can try approaches previously unavailable to you), and MFA is an absolute breeze.

Tip #670: If activities disappear, take this pill

Magic disappearanceWe’ve had one of the users reporting a really bizarre issue – all his activities have simply disappeared from CRM. The user was synchronizing with Outlook and activities are still present in the mailbox with Regarding field empty.

Thanks to Adam “Human Bing” Vero, the behavior is no longer a mystery but rather an annoying bug. After being reported by a number of people, Microsoft support stepped up and delivered a summary. Workaround is reproduced below just in case left button on your mouse does not work.

  1. Instead of creating the activities in CRM, create them in Outlook and track them in CRM. I don’t know if this is a silver bullet. I know in my testing I did not experience the same behavior if I created the object in Outlook first and tracked it. My customer saw similar results as well.
  2. Downgrade to Outlook 2013. This specific issue does not occur in Outlook 2013. I know we have other issues with Outlook 2013 that we need to further investigate but this specific issue does not repro in Outlook 2013.
  3. Remove the delete permission on activities. Obviously this is the most intrusive as it would prevent users from being able to delete activity records. This will prevent data loss from occurring in CRM.
  4. With 1 being too risky and 2 not being an option, I opted for 3. It’s not a bad practice anyway.