Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Hide Subgrid in Quickview form using Javascript

(2) ShareShare
ReportReport
Posted on by 4
I have this weird issue that I want to hide the subgrid in a quickview. The code ran however it left the navigation button like screenshot below:
 
 
My code: 
 
function test(executionContext) {
    var formContext = executionContext.getFormContext();
    const spouse = formContext.getAttribute("ips_spousename").getValue();
    var quickViewControl = formContext.ui.quickForms.get("memberQuickView");
    if (spouse !== null) {
        quickViewControl.getControl("spouse_subGrid").setVisible(false);
        quickViewControl.getControl("child_subGrid").setVisible(false);
        quickViewControl.getControl("dependent_subGrid").setVisible(false);
    }
}
 
Normally if hiding subgrid from control like: formContext.getControl().setVisible(false), the entire subgrid is gone. 

Is this a known issue, is there any workarounds? I do not want to use ribbon workbench as the button will need to use in other condition.
  • CU06121615-0 Profile Picture
    CU06121615-0 4 on at
    Hide Subgrid in Quickview form using Javascript
    Oh my mistake for not making it clear. My intention is to hide only 1 subgrid out of 3, the code is just for demonstration. I still need to keep the other 2 subgird as per the requirement
  • Suggested answer
    Amit Katariya007 Profile Picture
    Amit Katariya007 8,699 Super User 2024 Season 1 on at
    Hide Subgrid in Quickview form using Javascript
    You can hide quick view form rather than the Subgrids.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans