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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Sample JScript needed to hide 3 Subgrid buttons

(0) ShareShare
ReportReport
Posted on by

Hi, looking for a code snippet to handle hiding 3 Sub Grid buttons on the "WorkOrderList" subgrid - the 'Add Existing Work Order', 'Refresh', and 'Run Report' buttons.  Looking for Best Practice code with proper syntax, as I have not done this before with JScript.  See screencap below for more detail.  Thanks in advance!

 pastedimage1669650960679v1.png

I have the same question (0)
  • Suggested answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    afaik there is no supported javascript to remove that buttons, however it should be possible to hide them using ribbon workbench

  • Chrisbra22 Profile Picture
    on at

    Right. I had tried Ribbon Workbench and the buttons were not hiding, also I had existing code already that was showing/hiding tabs onLoad, so I was going to add code to that event.  Thanks.

  • Chrisbra22 Profile Picture
    on at

    Here are screenshots of the hide actions I took in Ribbon Workbench.  The is not working as I still see the buttons.  Any idea why this is not working?  If it continues to fail, I will need JScript.  

    -Added the Entity (Master Purchase Order)

    -Chose buttons, right-click - "Hide"

    -Publish

    -Go back to form, refresh, and buttons still appear...

    pastedimage1669656550127v1.png
    pastedimage1669656575257v2.png

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Chrisbra22 ,

    You can hide the button from the ribbon workbench as shown in the below screenshot

    pastedimage1669658751551v1.png

    If Hide functionality is unavailable, add the below code to handle visibility.

    function visibility()

    {

      return false;

    }

    For more details: powerplatformaw.blogspot.com/.../how-to-show-and-hide-button-based-on.html

  • Chrisbra22 Profile Picture
    on at

    Thanks.  The "Hide" option is there (see  my screenshots above).  But it is not working after a publish of the solution in Ribbon Workbench.  I am not sure why.  

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    The answer is quite obvious. You customized the Subgrid's Ribbon of the entity "Master Purchase Order" and you want to hide buttons of the ribbon of the "Work Order" entity - that's what you missed. Good luck.

  • Chrisbra22 Profile Picture
    on at

    OK. I assumed since the subgrid is contained in the Master Purchase Order entity that the solution needed that entity. I will try again.  

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 33 Most Valuable Professional

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans