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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

is it possible to show or hide the share button in Model Driven App

(0) ShareShare
ReportReport
Posted on by

pastedimage1679978856471v1.png
I was trying to use the ribbon workbench
but this button is not in there for me to edit. 
I was tried ON LOAD event with below code

function hidesharebutton(executionContext) {

    'use strict';   

    //window.top.document.getElementById("collaborationShareButton").style.display='none';   

    window.parent.document.getElementById("collaborationShareButton").style.display='none';

}



but it is giving me below error.

pastedimage1679979389597v2.png

what is the resolution for this issue.

  • Suggested answer
    XM-22040801-0 Profile Picture
    on at
    RE: is it possible to show or hide the share button in Model Driven App

    Hello,

    Using the DOM is not supported.

    You can do it with RibbonWorkbench or by using the rights.

    With RibbonWorkbench:

    1. Create a solution, add only the desired entity.

    2. Run RibbonWorkbench and open the solution.

    3. Click on the button (be careful, there is Share and Sharing).

    4. Right-click => Hide

    5. Publish

    With the rights :

    Remove the right to share on the desired entity in the relevant roles. This is the last dot on the right.

  • Suggested answer
    Haig Liu Profile Picture
    on at
    RE: is it possible to show or hide the share button in Model Driven App

    Hi Banne.5b3,

    The most suitable solution is to use security roles:

    pastedimage1680145717682v1.png

    System buttons cannot be edited using ribbon workbench or JS.

    If you insist, please refer to this link:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/how-to-hide-share-button-in-a-model-driven-app/td-p/1890331

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans