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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Hide ribbon button fro...
Power Apps
Unanswered

Hide ribbon button from One model driven app and visible to other model driven app

(0) ShareShare
ReportReport
Posted on by 971

Hi Experts,

 

I have a business requirement where I need to hide a button from one Model Driven App but it should be visible in another Model Driven App.

 

For instance - I have two Model Driven App Sales and Customer Service. And I have a custom button on Account entity. Now I would like this button to be visible in Sales App but it should not be visible in Customer Service App.

 

How can we achieve this?

 

Appreciate your response.

I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    468 on at

    Hi, 

     

    You can implement this with a Custom Enable Rule (JS Code). It is possible to have the application used with the function "getCurrentAppName". 


    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-utility/getglobalcontext/getcurrentappname

    https://d365demystified.com/category/ribbon-workbench/

     

    Good Luck !

     

  • Verified answer
    Bipin D365 Profile Picture
    971 on at

    Hi @melamri ,

     

    Thank you for your response!

     

    Is it possible to get current Model Driven App guid instead of name because I don't want to write logic based on Name. Any developer/Business Users can change the name of the moderl driven app and in that case I will have  to modify my Javascript code which I don't want.

     

    Thanks,

    Bipin

  • Verified answer
    Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Dear @bipinshan,

     

    Hope you are doing good.

     

    You can follow below steps

     

    1. Create Environment Variable or Configuration Record For Storing APP ID as a String with GUID

     

    Then in onVisible of Button use below script

     

    var globalContext = Xrm.Utility.getGlobalContext();

        globalContext.getCurrentAppProperties().then(

            function success(app) {

                console.log(app);

                console.log(app.appId);// compare the I'd with config or environment variable and return False or true

            },

            function errorCallback() {

                console.log("Error");

            });

    }

     

    Hope this helps

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     

     

  • Verified answer
    Bipin D365 Profile Picture
    971 on at

    Hi @rampprakash ,

     

    Thank you for your reply.

     

    I wanted to do through App ID and you have provided the exact code for that.

     

    Thanks,

    Bipin

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard