If you have ever worked in Dynamics 365 implementation then it is almost certain that you must have played around with ribbons. And more often than not you must have faced scenario where you have multiple enable and display rules on the form and not sure why the ribbon button is showing up on the form when it is supposed not to show up or vice versa.
And what we do to resolve it. Well, we play around with the ribbon customizations which takes much more time than other customizations in Dynamics 365. And if it is some custom rule, we would attach debuggers to our custom code and debug and find what is going wrong.
What if I tell you that Microsoft just released something which shall help you identify which of your ribbon rule is evaluating to what in a matter of few mins so that you can pin-point to the exact rule which is the culprit. Ta-da! Introducing to you the new Command Checker from Microsoft. You can find the details about the release right here.
In this blog I shall show you some scenarios.
So let’s take a simple example here. I have inserted one custom button called – “Command Checker Test” on the Contact form.
I basically have two rules for the custom button.
1. One display rule – CommandClientTypeRule to show it only on Modern interface.
2. A custom rule where I am returning true or false based on some business logic.
It’s the most complex logic I could have thought of in the Cornona Lockdown and don’t beat me up for this.
function showHideCommandChecker(fc) {
// sample code.
var jobTitle = fc.getAttribute(“jobtitle”);
if (jobTitle.getValue() !== null) {
return true;
}
return false;
}
And now comes the grand entrance of the “Command Checker”. I open up a contact record. My button is right there. But wait where is the command checker. It ain’t there?
It’s a magic wand. You just don’t get it. You have to conjure it up. And the way to do it is just by appending a query string parameter “ribbondebug=true” to the URL of the entity record
And now you see the command checker tool. If you don’t see it, it might be hidden under your ellipsis area like in mine case too.
What happens when we click it? Magic!
You have all your ribbons buttons with their command and actions. Let’ select our Command Checker button.
If I check the command properties, I can see which rules evaluated to true or false so that you can identify why the button is being shown or rather not being shown.
As you can see from the above screenshot, we can see the enable rule and the display rule being both evaluated to true. Wonderful isn’t it? We know exactly which rule evaluated to what.
Not only that, when we have multiple solutions installed, we can even see which solution is in effect by viewing the rule definition and solution layers.
I will leave it here and you can explore more detail in the Microsoft link here which is mentioned above as well. And guess what, I just loved exploring it while I was penning this blog down.
Hope this helps!
Debajit Dutta
(Dynamics MVP)
For consultation/ corporate training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com
Our product offerings:
Role based views for Dynamics 365 (http://www.xrmforyou.com/role-based-views.html)
CRM-Sharepoint Attachment uploader and metadata manager (http://www.xrmforyou.com/sharepoint-integrator.html)
Record Cloner for Dynamics 365 (http://www.xrmforyou.com/record-cloner.html)
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.
Reblogged this on Arun Potti's MS CRM blog.
Thanks for sharing this Debajit.
Reblogged this on Nishant Rana's Weblog and commented:
Command checker – another awesome tool in Dynamics 365.