Home Ask Login Register

Developers Planet

Your answer is one click away!

erin c February 2016

Hiding a ribbon button when specific Dynamics CRM Web Resource is in context

Like most of dynamics crm programmers know, we can add "web resources that are not associated with any entity" to the sitemap. If such a customization is made, when user clicks that link, web resource will be opened and the buttons in the application ribbon will be added to the ribbon section of the dynamics crm.

What I am wondering is if there is any way I can hide this global buttons that are in the application ribbon based on the web resource on the page.

Let's say I added more than one web resources to my sitemap, namely a.htm and b.htm. Let's say I have a custom button named x in the application ribbon. Right now x is displayed both for a.htm and b.htm, but in reality I would like to hide the button when user clicks on b.htm from the sitemap.

Is there a way to accomplish that?


S.Dav February 2016

You could use the following (unsupported) code to hide the Ribbon button (the 'Run Workflow' button in this example):

var btnRunWorklfow=top.document.getElementById("account|NoRelationship|Form|Mscrm.Form.account.RunWorkflow-Large");

You can also use ribbon editor available in codeplex to disable your button based on your javascript.

Refer to: http://crmvisualribbonedit.codeplex.com/

erin c February 2016

I figured there is no supported way of doing this.

Post Status

Asked in February 2016
Viewed 3,046 times
Voted 10
Answered 2 times


Leave an answer

Quote of the day: live life