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.

VN:F [1.9.22_1171]
Rating: 2.5/5 (2 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

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
  }
}
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

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.

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

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

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

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

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.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

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.

    VN:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    Tweet about this on TwitterShare on FacebookShare on Google+

Tip #669: Organizing Unified Service Desk development environment

Disorganized desktopThis is for folks who write code as part of their jobs and for whom USD stands for Unified Service Desk and not United States Dollar.

If you’re developing custom hosted controls, the easiest way to ensure that the version is correct and all dependencies are included is to set up USD program folder as the output for your build process.

It works but sooner than you know, the folder is a mess, versions of dependent assemblies are out of sync with production which makes it real fun to troubleshoot, and the real issues begin when you have more than one control to develop or when you need to reproduce a production issue.

Unless you simply create a copy of your USD program folder because USD really does not care where does it run from and has no location dependencies.

  1. Copy the entire USD program folder (default C:\Program Files\Microsoft Dynamics CRM USD\USD) into another location on your disk (e.g. c:\dev\usd).
  2. Set this folder as the destination for your program output and set UnifiedServiceDesk.exe as the start program.
  3. Set the breakpoints in your hosted control code and fire away.
  4. Compare this folder with the original one to build a baseline for what needs to be included for your control to work. That will help you to build the customization file for your distribution.
  5. Need quickly to test something or develop completely independent control? Just create another copy of the USD folder!
VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

Tip #668: ADFS and CRM on the same server

Overflowing bagThere are reasons to do the unspeakable, ignore all recommendations and install all components of on-premises CRM deployment on a single machine. Running CRM on my laptop, for example, as I don’t have room for 3 server deployment.

tl;dr

If CRM and AD FS are on the same server, change port used by AD FS.

Boring technical details

Browser works fine but attempt to access organization in code generates “The authentication endpoint Username was not found on the configured Secure Token Service” error.

Our fellow MVP 罗勇 to the rescue:

When installing Microsoft Dynamics CRM on the same server as Windows Server 2012 R2 AD FS (not a recommended scenario), you may need to change the port used by AD FS to a port other than TCP 808. Sandbox Processing Service listens on Port 808, Microsoft Dynamics CRM Asynchronous Service and Web Application Server services communicates with the Sandbox Processing Service on Port 808. A port conflict could also cause issues for Microsoft Dynamics CRM Email Router, Microsoft Dynamics CRM for Outlook, and the Plug-in Registration Tool.

Check your AD FS event log for EventID 102 and the following in Exception details: “System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:808.” If this exists, you need to change your AD FS port.

To change the port used by AD FS to another port such as 809, use the following PowerShell command:

Set-ADFSProperties -nettcpport 809 

Restart AD FS Windows service.

VN:F [1.9.22_1171]
Rating: 3.0/5 (1 vote cast)
Tweet about this on TwitterShare on FacebookShare on Google+

Tip #667: Return from the Land of No Return

Wherein we learn to disable the Notes, Activities, Connections, Feedback, Queues, And/Or change the “Ownership” model option on a Custom Entity.

Why do I Care?

Recently I received a solution file where EVERY custom entity had been created with ALL the default options enabled. Even entitles that serve only as simple “lookup” lists had Notes/Activities/Connections/Feedback enabled on them – before putting those entities into production, I needed to ‘unselect’ these options – this tip explains shares how I accomplished this.

SNAGHTML3cc0c68fMy perspective on why to /not/ enable these options by default is that the more places people can create records, the more places someone would have to go look in order to find those records and more importantly, when they go to create a new Note/Activity/Connection, etc. the list of potential targets is large and harder to quickly spot the “Big 4” – Accounts, Contacts, Opportunities, Cases.

It wasn’t long ago that a certain beautiful, slick-headed man named George  presented an excellent roadmap to The Land of No Return – wherein if the entity creator either set the security model to ‘organization’ or forgets to disable any of the irreversible default options when creating a new entity, CRM does not offer the opportunity to change these options.

Avoiding the Land of No Return

It’s important to point out that the easiest way to avoid this, is to just uncheck the options before creating the custom entity. – If you *just now* accidentally created a new entity and you haven’t really started configuring it – or if it’s a really simple entity, just delete it and re-create it. (I have heard of sr. architects just assigning the task to a junior consultant as a way to give them experience – or help them learn from their mistakes – which is also far more human-resources department friendly than Spießrutenlaufen.)

In my situation, the entity had already been created by the vendor – with all the forms, fields, views, charts etc. – I didn’t want to go through the process of re-creating all of that by hand, so I leveraged CRM 2016’s “Solution Segmentation” feature to move the entity’s components without those options. The advantages of the vastly improved solution segmentation in CRM 2016 and later makes this possible in a way that was never possible in a supported manner before.

Prerequisites for the Solution

1) This requires CRM 2016 and later – Earlier versions of CRM had significantly less flexibility when it came to configuring solutions.

2) This is absolutely easiest if you don’t already have production data in the entity. (If there is already production data in the entity, you’ll need backups all around because at one point you’ll need to delete and recreate this entity – and then repopulate it if needed. – If this entity has custom 1:N relationships and many of those are already populated, please carefully weigh the effort of backing up and restoring this data, specially in related ‘child’ entities – vs. the challenge of just learning to live with the entity as-is.)

3) You’ll need a temporary location to publish this entity to – if the target entity has lots of relationships to other custom entities, those will need to exist in the temporary location as well. – In my case the entities I wanted to re-create all pointed to either Accounts or Contacts or each other.

4) This solution is designed with only unmanaged custom entities in mind.

5) Since you’ll need to be able to delete and re-create this entity, you will temporarily remove it from any sub-grids and also note where it is listed in the Sitemap.

The Solution

1) For each entity you want to clear of these options, manually create a new entity in the TEMP environment with the EXACT same schema name (including prefix) as the existing entity – and be absolutely sure to clear all the unwanted checkboxes and set the ownership appropriately before hitting ‘save’.

2) Create a new solution in the SOURCE environment and include the entity (or entities) you wish to modify-

3) UNcheck the option to include “all assets” and “entity metadata”
image

4) Check and select all the Forms, Views, Charts, Keys, Business Rules and Hierarchy Settings on those tabs.

5) On the ‘Fields’ tab and the three relationships tabs (1:N, N:1, NN) – change the filter to “Custom” and select all.

6) Save and Export the solution as Unmanaged and then Import it into the TEMP environment.

7) TEST TEST TEST in the new environment and make adjustments as needed.

8) Delete the entity in your SOURCE environment (you backed up all needed data right?)

9) Create a new, unmanaged, solution in the TEMP environment and export WITH the all assets and entity metadata options checked.

10) Import the new solution back into the SOURCE environment, configure the entity’s custom icons if needed, add it back to any subgrids if needed, and publish (and then re-import data if applicable.)

See, that wasn’t so bad, but it’s still easier to remember to uncheck those boxes to begin with, amiright?

VN:F [1.9.22_1171]
Rating: 5.0/5 (7 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+

Tip #666: Don’t break the law with the portals

Don't be evil by sending promotional SMSI rarely read terms of service but something jumped at me when trying to install the portal solution:

The license terms for the Online Service apply to your use of this supplement, except as follows:

Customer is explicitly prohibited from using the supplement to design and transmit promotional SMS messages either via the Twilio integration feature or as otherwise may be possible.

Why is transmission of promotional SMS messages explicitly prohibited?

One of the portal modules is SMS messaging included to support two factor authentication. And the supplied out-of-the-box provider is Twilio (don’t get too excited – you still need to supply paid account). Twilio has restrictions against using their service for promotional/spam messages to comply with the relevant anti-spam laws. And so does every other reputable SMS provider.

Twilio or not, but the license terms reinforce that the team doesn’t want to be enabling customers to use their product to break the law.

VN:F [1.9.22_1171]
Rating: 0.0/5 (0 votes cast)
Tweet about this on TwitterShare on FacebookShare on Google+