Skip to main content
Community site session details

Community site session details

Session Id : FCXqyDv3XSvQUC7tBWnx+K
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Hide New button on Quickview subgrid

Like (0) ShareShare
ReportReport
Posted on 7 Dec 2020 18:10:39 by 306

In my model-driven app, I have a QuickView Form for a table that has two subgrids on it for related tables.  For those subgrids, I don't want the "New" ribbon option to be available.  But for those same related tables, I DO want the New option available when those subgrids are on a Main form.  I can use Ribbon Workbench to hide the New option for all subgrids.  But, is there a way to only hide it when on a QuickView form?  I could use a different View for the subgrid on the QuickView form, but I don't see a way to specify ribbon options for specific Views.

  • AN-09080954-0 Profile Picture
    Microsoft Employee on 06 Dec 2022 at 15:13:13
    Re: Hide New button on Quickview subgrid

    Hi, for your scenario,
    I believe you will be using quick view form on some other table. So, you can add an enable rule (Custom rule) to the "New" button of the subgrid with a parameter as Primary Control and use below code to get the entity information of the parent entity.


    var showButton = true;
    var formContext = primaryControl;
    if (formContext.parentFormContext !== null && formContext.parentFormContext !== undefined) {
    var parentEntityName = formContext.parentFormContext.data.entity.getEntityName();
    if (parentEntityName == {parent entity name}) {
    showButton = false;
    }
    }

    return showButton;

     

    With the above code, if I am using the quick view form of table "ABC" on table "DEF", "formContext" would be context of table "ABC" and "formContext.parentFormContext" would be the context of table "DEF".
    So, on table "DEF", my quick view form won't show the "New" subgrid button, but on the main form it will show.


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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Loading complete