Tip #681: Hunting down invisible timeouts

Hunting down timeoutsApplication Request Routing (ARR) feature allows creating a reverse proxy front-end for your on-premises deployment. Web Application Proxy (WAP) is another (newer) kid on the block allowing DMZ deployments of CRM.

We’ve been successfully using both for quite some time and they are way down on the list of suspects when things go wrong. And go wrong things did for one of the customers – some of the reports were coming back blank. No message, nothing, the progress message disappears but the report window stays blank. Since smaller reports were coming back fine, it did smell like a timeout issue but we couldn’t figure out where.

Turns out, report viewer control does not handle some of the errors very well – server was sending back error “502 – Bad gateway” and it was simply ignored by the report viewer.

502? Bad gateway? Why reports? Luckily, IIS has a nifty Failed Request Tracing feature. Enabling that did show up the 502 but it also showed a timeout error. Doh! We were hitting a known “misinterpretation” of the 502 error.

Go to your Server Farms > Farm name > Proxy and increase the timeout. Reports are back and customer happy.

Important lesson: there are multiple components in CRM deployments and each one can generate a timeout error:

  • Reporting Server
  • SQL Server
  • CRM Server
  • ARR/WAP/Reverse proxy (if you dare)
  • Firewall? (never seen one of this timing out but they do have a software component so I wouldn’t be surprised)

Request tracing & logging on both client and server(s) are usually your best friends when troubleshooting timeout issues.

Tip #680: No more excuses for not using SSL

Connection privacy errorWe all know about the goodness of SSL. CRM Online and On-premises IFD deployments won’t work without it. However, when it comes to creating and consuming web services, people become incredibly lax about using SSLs and happy to transmit even confidential information using plain http. Excuse is usually down the “who needs this information anyway” lines:

What kind of hacker would want to access an x-ray image of your right foot?

Another frequently cited excuses has always been cost of SSL certificates. Let’s be honest – majority of providers did bugger all to verify the identities, or provide any services in addition to issuing a certificate, and then charged exorbitant prices for simple SSL certificates and then some more for the wildcard versions.

Well, you have just run out of excuses. https://letsencrypt.org/ is a new Certificate Authority: free, automated, and open. Go ahead and generate your own certificates as needed.

Before plunging in head-first, few things to consider:

  • Wildcard certificates are not supported yet. While you can have up to 100 alternative domain names on a single certificate, some scenarios, IFD of CRM in particular, are much easier to handle with a wildcard.
  • Let’s Encrypt certificates currently have a 90-day lifetime. There are a lot of arguments pros and cons but the bottom line is that, at the moment, in the IIS-bound world CRMers live in, there is an additional overhead to renew.
  • Let’s Encrypt certificates cannot be used for code signing or email encryption. Nope, SSL/TLS only.
  • They do not store private keys. Lost the key? 90-days lifetime suddenly looks very appealing.
  • Let’s Encrypt has no plans to issue EV (Extended Validation) or OV (Organization Validation) certificates at this time.

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).