Skip to main content

Notifications

Announcements

No record found.

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

Unable to hide fields of Quick View form using javascript

(0) ShareShare
ReportReport
Posted on by 10

I am unable to hide fields of Quick View form on unified interface using javascript. I am using below code for hiding fields inside quick view form. This code works on Classic UI of CRM but doent work on Unified interface.

//function to show or hide fields of Quick View Form
function hideQuickViewFormFields(executionContext) {
    var functionName = "hideQuickViewFormFields";
    try {
        //check executionContect is Valid or not
        if (executionContext != null && executionContext != undefined) {
            //get formContext
            var formContext = executionContext.getFormContext();
            //check formcontext is Valid or not
            if (formContext != null && formContext != undefined) {
                var quickViewControl = formContext.ui.quickForms.get("contactquickviewform");
                if (quickViewControl != null && quickViewControl != undefined) {
                    quickViewControl.getControl("firstname").setVisible(false);
                }
            }
        }
    }
    catch (ex) {
    }
}
I am not able to hide the fields of Quick view form on UCI and also not getting any errors.
Please let me know if any one able to hide the fields of Quick view form on UCI.
Thanks,
  • Suggested answer
    Abdul Wahab Profile Picture
    Abdul Wahab 12,077 Super User 2024 Season 1 on at
    RE: Unable to hide fields of Quick View form using javascript

    Hi Sanket1751991,

    Article might help you https://www.magnetismsolutions.com/blog/jordanhohepa/2018/08/23/using-javascript-to-set-quick-view-form-visibility-in-dynamics-365

    Let me know if You need anything else.

    Thanks

    Regards,

    AW

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Unable to hide fields of Quick View form using javascript

    Hi,

    This should be working and is supported (docs.microsoft.com/.../formcontext-ui-quickforms)

    I did a quick test in the browser console (so that's why I use Xrm.Page in the code below and not executionContext.getFormContext()) on the default account form of a vanilla environment, and the field gets hidden:

    var quickViewControl = Xrm.Page.ui.quickForms.get("contactquickform");

    quickViewControl.getControl("emailaddress1").setVisible(false);

    With your Quick View Form and Field, this should be:

    var quickViewControl = Xrm.Page.ui.quickForms.get("contactquickviewform");

    quickViewControl.getControl("firstname").setVisible(false);

    This might help you get to the bottom of it.

    If you can't troubleshoot it, consider opening a support request: admin.powerplatform.microsoft.com/support

    Henry

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,433 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans