Tip #579: Prioritize your relationships

When creating new relationships, change the Display Order property from the default 10,000 to a higher value, e.g. 20,000.
DIsplay Order for relationship
Sooner or later business users will ask to prioritize the order in which related entities appear and if by that time you have created 42 relationship with the default order 10,000, reordering them will be a tedious exercise.

Tip #578: No privacy in Interactive Service Hub

When trying to access Interactive Service Hub you may receive “Sorry, something went wrong while initializing the app” error:
Interactive Service Hub error
It’s caused by in-private mode in the browser (which is a standard approach to work with multiple CRM environments). Good news is that it’s a known issue and the fix is in a pipeline. Until then just stop being so secretive and use “normal” browsing mode and multiple browsers to get to the different orgs.

Tip #577: Tipster guide to Dynamics CRM Hierarchical Visualizations

¡Hola! Es viernes, mis amigos and that means tacos and another video.

Hierarchical Visualizations provide a great way to work with hierarchical data in Dynamics CRM both on system and custom entities. In this video we show you how to define a hierarchical relationship, configure the settings, and consume them in CRM.

YouTube player

Don’t forget the oil change if you upgraded to 2015.

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.

Tip #576: Business Process Flow can be updated on closed opportunity

Mini Truckstop

Dynamics CRM TipperEverybody knows who Tanguy “The XRM Toolbox” Touzard is. That’s right, a legend. But being a CRM legend does not mean knowing everything – it’s knowing when to ask the right questions.

Question

For one of my customers, it seems that when you are on a won Opportunity form, you can change BPF stage, whereas the opportunity is read only

Is this a known bug?

Answer

The answer comes from the authoritative source who shall remain anonymous:

This is by design and following is the rationale.

Business processes are across entities and hence can be updated irrespective of the participating entity’s record state.

For example, Lead – Opportunity – Quote process might have 2 stages for each entity and user can decide to close the opportunity at stage 1 itself. Now if system locks the process on closed opportunity stage 1 – it can never be moved to the quote stage.

Note that the entity fields present on the process stage are LOCKED for modification if the record is read only. This effectively means that the process can be update but the record cannot. Also for the closed records, processes are not assigned automatically.

Tip #575: Check your clocks

tl;dr

Don't look at our crotches while we synchronize our watches!If you receive an error “An error occurred when verifying security for the message” when connecting to Dynamics CRM, verify that the clocks on the client and the servers are no further than 5 minutes apart.

Just a bit longer

Code that was working yesterday refuses to run and spits an error on the very first message sent to CRM:
An unsecured or incorrectly secured fault was received from the other party. See the inner FaultException for the fault code and detail.
The clue is, in fact, in the inner message:
An error occurred when verifying security for the message.
Quick search reveals that I’m not the only one, and it’s been dealt with before by analyzing server logs (not available, of course, for CRM Online but on-premises it’s a good option). Step by step troubleshooting instructions are in the knowledge base article that deals with Outlook connectivity issues (the root cause is the same).

Worth noting that the lines:

CrmConnection con = new CrmConnection("connstring");
OrganizationService svc = new OrganizationService(con);

do not mean “connecting to CRM”. Connection will not be authenticated until the first use. That’s why, where applicable, I tend to write:

CrmConnection con = new CrmConnection("connstring");
OrganizationService svc = new OrganizationService(con);
svc.Execute<WhoAmIResponse>(new WhoAmIRequest());

that way, if it fails, it’ll be very early in the execution.

Tip #574: Hidden sources of javascript errors

Quite often developers complain about getting javascript errors when the form does not contain any scripts or events. Explicit script definitions are not the only source of the possible errors:

  • Business Rules are deployed on the client as generated javascript. While it’s unlikely that business rules will generate an erroneous script, it’s worthwhile disabling the rules and see if the problem goes away. For CRM Online you can check the scripts generated using Business Rules Viewer at http://xrm.tools.
  • If the form contains html web resources, those resources can load scripts that interact with the form:

    An HTML web resource may interact with the Xrm.Page or Xrm.Utility objects within the form

  • Application and entities ribbons can load javascript resources as part of the action definition. You can check the presence of the commands by inspecting the ribbons using Ribbon Workbench. Note: if you entity does not have any ribbon definitions, it’s not a get our of jail free card. Third-party managed solutions can add their own command definitions to the ribbons and they won’t appear as part of your entity customizations. Hunting down those is a hit and miss exercise, vendor documentation and visual inspection of the ribbons and comparing them with the default ones is a good start.

Did we miss anything? Tell us at jar@crmtipoftheday.com.

Tip #573: CRM Online vs CRM On-premises features FAQ

Celebrity deathmatchSomeone at Microsoft has heard our online vs on-premises battle and decided to resolve it once and for all.

CRM 2016 – Online vs on-premises features FAQ is now available on the Help & Training site.

Some things are interesting and unexpected, others – not so much (like “Switch or delete an instance of CRM Online” feature is available for CRM Online only. Well, duh…)

Tip #572: Tipster guide to Dynamics CRM 2016 Customizing for Interactive Service Hub

if(today == Friday) 
{
   post.Category = Categories.Video;
}

In this video we introduce to the new customizations options that are available for the new Interactive Service Hub as part of Dynamics CRM 2016. We will look at the new interactive Dashboards, entity forms, and entity dashboards.

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.

Tip #571: Unable to publish solution with calculated fields

If you attempt to publish a solution containing an entity with calculated fields, you may receive the following error message:

Field foo_calculated cannot be created or updated because field foo_used_in_condition_or_formula contains an additional formula that uses a parent record.

The wording is misleading and confusing because field foo_used_in_condition_or_formula is not a calculated field at all. The error is documented as:

ErrorId ManagedErrorName ErrorMessage
80060433 CalculatedFieldsEntitiesExceeded Field {0} cannot be created or updated because field {1} contains an additional formula that uses a parent record.

Which does not make it even remotely clearer.

What the error is trying to say is that there is a child entity with calculated fields that refer to foo_calculated field. Solution, as it turns out, is very simple:

If your entity contains a calculated field that is used in formulas of calculated fields of another (child) entity, make sure to include this child entity in your solution

Tip #570: Remote debugging in CRM with vorlon.js

Our resident visual effects tipster asked me the other day if I had any experience with using vorlon.js in CRM. I didn’t as I never heard of it. But since someone somewhere some time ago pointed out that these days <random noun>.js is probably a valid javascript library, I decided to take a look.

As it turns out, vorlon.js is a very cool

An open source, extensible, platform-agnostic tool for remotely debugging and testing your JavaScript. Powered by node.js and socket.io

Steps to enable vorlon for your CRM:

  1. Install node and npm. Easiest way to do it is to use PowerShell
    install-package -name nodejs
    install-package -name npm
    
  2. CRM won’t allow loading anything over http and we’ll need a certificate that we can generate ourselves using openssl.
    install-package -name "openssl.light"
    openssl genrsa -des3 -out server.key 1024
    openssl req -new -key server.key -out server.crt
    copy server.* c:\temp
    
  3. To make browsers to trust our dodgy certificate, import server.crt into Trusted Root Certification Authorities store (e.g. using mmc certificate snapin)
  4. Install vorlon
    npm i -g vorlon
    
  5. Modify server/config.json to enable ssl
        "useSSL": true,
        "SSLkey": "c:/temp/server.key",
        "SSLcert": "c:/temp/server.crt",
    
  6. And run it
    vorlon
    
  7. Open browser and point to https://localhost:1337. We have a lift off but now what?
  8. Create an html web resource and insert it into any CRM form
    <html>
      <head>
        <script 
          src="https://localhost:1337/vorlon.js">
        </script>
      </head>
      <body>
        <h1>Vorlon</h1>
        <p>Vorlon lives here</p>
      </body>
    </html>
    
  9. Load that form
    Vorlon host on CRM Form
  10. And here you have it!
  11. Object explorer in Vorlon

  12. You can now use console, for example, peek at the data
    Look at the data with Vorlon

Big deal, you say, because you can use magic F12 and achieve the same result? Well, yes, except all of the above works remotely, e.g. you can debug stuff on the user’s machine over the network.

Early days, of course, few additional notes to get you going:

  • DOM explorer is not very useful as its root is at the resource level. Injecting vorlon into CRM window is probably an option to consider
  • Create delayed load to debug only when needed. (See vorlon.js documentation for more details and options)
    <!-- load without autostart -->
    <script src=
    "https://host:1337/vorlon.max.autostartdisabled.js">
    </script>
    
    <!-- bind this to a button on command bar -->
    VORLON.Core.StartClientSide(
       "https://host:1337", 
       "default");
    
  • Last but not least: use at your own risk, contains small parts, choking hazard, swim between the flags. Not tested on animals, children or CRM 2011.