Skip to main content

Notifications

Announcements

No record found.

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

How can I filter subgrid using JavaScript in UCI?

Posted on by 155

Hi folks

I may have missed some quality post on this topic but after a quick search, I've found most of the posts from classic interface not the UCI or the unsupported way of doing it (not sure why it's unsupported though). 

I would like to know, what's the best way to filter the subgrid using JS? 

Problem

I only have to show certain records in a subgrid based upon some dynamic value. 

Thanks in advance

Arafat

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: How can I filter subgrid using JavaScript in UCI?

    Hi Partner,

    Unfortunately, UCI does not support customise the subgrid filter condition by any code, so you could raise an idea to Microsoft about your requirement.

    Regards,

    Leo

  • Arafat Profile Picture
    Arafat 155 on at
    RE: How can I filter subgrid using JavaScript in UCI?

    Unfortunately, for 500 unique dynamic values, I cannot create 500 views and show-hide on the basis of that. I think some other way would be better to look at.

  • Suggested answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: How can I filter subgrid using JavaScript in UCI?

    Hi partner,

    Since UCI does not support getting DOM directly to get the controls, there is no OOB way to do custom filter in subgrid.

    You could refer to the following points.

    1.Create multiple subgrids on the form, and show or hide them based on your dynamic value.

    pastedimage1595486371398v1.png

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/setvisible

    2.Create multiple views for the entity in subgrid, and choose the view you need based on your dynamics value.

    pastedimage1595486429095v2.png

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/grids/viewselector/setcurrentview

    You could refer to this blog for other ways and details.

    https://goutamdascrm.wordpress.com/tag/subgrid-custom-filter/

    Regards,

    Leo

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans