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,...
Answered

Hiding the subgrid, retains the ribbon buttons

(0) ShareShare
ReportReport
Posted on by 40

Hello,

I have a account entity quick view form on a case form. The QV form shows a grid showing all cases for the account. On some condition, I want to hide the grid. The hiding (setVisible(false)) is working, but it weirdly retains the the subgrid's ribbon buttons and the pagination. How to hide the entire subgrid?

pastedimage1619496632246v1.png

Thanks!

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi partnrt,

    Are you using js code to hide sub-grid of the quick view form?

    If so, you can refer following link to check your code:

    Accessing fields on QuickView Form (Control) through JavaScript in Dynamics 365 – Nishant Rana's Weblog

    If your code is not wrong, maybe you can try to create new section in the quick view form, then drag sub-grid to the section.

    pastedimage1619516761578v1.png

    Then you can hide or show the section that include case sub-grid based on your condition in js code.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • itsdeshpande Profile Picture
    40 on at

    Thanks Leah. The issue is that it looks like the visibility changes don't affect the sections on a quick view. I already have the grid on a section. But because the visibility toggle doesn't work with the section, I am trying to hide the grid instead. This is what I am trying:

           const custTab = formContext.ui.quickForms.get("Account");

           const testSubgrid = custTab.getControl("relatedCaseGrid");

           const tab = custTab.ui.tabs.get("tab_1");

           const section = tab.sections.get("Cases_Section");

           section.setVisible(false); // for the section

    OR

          testSubgrid.setVisible(false); // for the subgrid

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi partner,

    If so, you can hide the quick view control itself directly. And the quick view form control only includes the case sub-grid.

    pastedimage1619589544584v1.png

    Here are code to hide quick view control:

        var quickViewControl = formContext.ui.quickForms.get("accountQV");

        quickViewControl.setVisible(false);

    If you need other fields account entity, you can create a new another quick view form to add these fields as your need.

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • itsdeshpande Profile Picture
    40 on at

    Thanks Leah. If I hide the QV itself, then entire form is gone. Sorry I should have been clearer before. I have a few fields in one section. In a second section I have only the grid. I want the fields to be available, but only the subgrid to hide based on this condition.

    Unfortunately, we cannot add another tab also on a QV.

    If I add another new QV as you suggested, and hide this as per your screenshot, how can I make the new QV form show up in the same place? Because as per the screenshot you have, the QV is the one assigned on the field, and that we have hidden. Now we want the new QV to show in its place.

    Thanks!

  • Verified answer
    Community Member Profile Picture
    on at

    Hi partner,

    When one quick view form control has been hidden, another quick view form control will replace it’s place automatically.

    Before:                                              After:

    pastedimage1619664536069v1.png  pastedimage1619665016318v3.png

    Regards,

    Leah Ju

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Suggested answer
    itsdeshpande Profile Picture
    40 on at

    Thanks Leah. Although one thought about this is that if there are multiple quick view forms, which one will replace the old one? Maybe in that case we have to explicitly toggle the visibility of the forms we want, and that's what I did. Thank you so much for all your help and suggestions.

    Here is what I did eventually:

    const QV1 = formContext.ui.quickForms.get("Account1");
    const QV2 = formContext.ui.quickForms.get("Account2");
    if (< some condition >) {
    QV1.setVisible(false);
    } else {
    QV2.setVisible(false);
    }

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 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

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

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans