web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Hide/Show Button on a specific Model Driven App

(0) ShareShare
ReportReport
Posted on by 1,848

Hi All,

I have multiple Model Driven Apps but I want to show a custom button on a specific Model Driven App on Activities and hide all other buttons.

How can I achieve this using Ribbon Workbench?

How can I get the app name and show/hide the button accordingly?

I have the same question (0)
  • Suggested answer
    StefanS365 Profile Picture
    3,575 Most Valuable Professional on at

    Hi M,

    Here is an example of how to do that with the help of the Ribbon Workbench:

    butenko.pro/.../

  • MNarmeen Profile Picture
    1,848 on at

    Thanks, I was following the same link but the button appears on the form and it gets formcontext to hide/show. But in my case the button is on the Home.Grid view and need globalcontext.

    I am not sure how to pass Globalcontext in CRM parameters in Enable Rule.

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    You can use below to get the global context and check the App properties-

    =====

    var globalContext = Xrm.Utility.getGlobalContext();

    globalContext.getCurrentAppProperties().then(successCallback, errorCallback);

    ======

    docs.microsoft.com/.../getcurrentappproperties

    Hope this helps.

  • MNarmeen Profile Picture
    1,848 on at

    Hey Ravi,

    I already tried that but I don't get the app name.

    AppName.PNG

  • Verified answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    Can you try below code-

    =================

    var AB = AB || {};

    AB.Ribbon = (function () {

       //defaulting button visibility and promise completion to false

       var isButtonEnabled = false;

       var isPromiseCompleted = false;

       function IsButtonEnabled(formContext, appUniqueName) {        

           var appName;

           var globalContext = Xrm.Utility.getGlobalContext();

           globalContext.context.getCurrentAppProperties().then(

               function (appProperties) {

               appName = appProperties.uniqueName;

           },

               function (error) {

                   appName = "";

           }

           );

           alert(appName);

       }

       return {

           IsButtonEnabled: IsButtonEnabled

       };

    })();

    =======================

  • MNarmeen Profile Picture
    1,848 on at

    Can anyone please let me know how to refresh HomeGrid ribbon on Javascript?

  • Yasaswini Uppala Profile Picture
    30 on at

    Hello,

    Have you achieved this functionality? If so, could you please let me know the correction you made as I m trying to implement the same.

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 192 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans