Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

In Hub, how to filter subgrid, using JavaScript or Plugin

(0) ShareShare
ReportReport
Posted on by

Hi All,


The fetchxml I need is with linked entity and with 'under' condition.

'<link-entity name="account" from="accountid" to="customerid" link-type="inner" alias="bm">' +
 '<filter type="and">' +
 '<condition attribute="accountid" operator="under" uitype="account" value="{' + accountId + '}" />' +
 '</filter>' +
'</link-entity>'

The JavaScript and Plugin both are working in traditional Dynamics 365, but NOT in HUB.
Let me tell you, what I have tried.

JavaScript, I tried these to set and refresh:
formContext.getControl("subgridname").getGrid().setParameter("fetchXml", fetchXml);
parent.Xrm.Page.getControl("subgridname").setFilterXml(fetchXml)
window.parent.document.getElementById("subgridname");   -> cannot find 'control' using this one.

plugin, I tried on 'RetrieveMultiple' event and replace context.InputParameters["Query"]

With either JavaScript or Plugin,
As the subgrid shows correct result in traditional Dynamics 365, could I think, this is another defect in Hub?

If anyone has working examples in HUB, could you peleas share?

Thank you very much in advance. 

Regards,

Zhenyu

*This post is locked for comments

  • RHOU Profile Picture
    65 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    I just created a very detailed feature wish to make this happen in a supported way for Unified Interface here:

    PLEASE VOTE!

    powerusers.microsoft.com/.../675538

  • rthompson Profile Picture
    1,530 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    This link works great.

    mkdynamicsunfied.blogspot.com/.../filter-subgrid-in-dynamics-unified-hub.html

    I had to change my condition uinname and value around.

      ""
      ""

  • rthompson Profile Picture
    1,530 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi Moin,

    Not much information on how to get the UCI filter on subgrid to work.

    I found your link mkdynamicsunfied.blogspot.com/.../filter-subgrid-in-dynamics-unified-hub.html but I am getting a error message.

    I have a question.

    When filtering is the existing view condition being replace or do I need to also add the attributes that will need to appear in the grid.

    7418.SubgridError.JPG

    FetchXml

    var fetchXml = ""
                  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                  ""
                  ""
                  ""
                  ""
                  ""
                  "";

  • Suggested answer
    MMK Profile Picture
    745 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi All

    here I have solution that works for both UCI and Classic

    mkdynamicsunfied.blogspot.com/.../filter-subgrid-in-dynamics-unified-hub.html

  • MMK Profile Picture
    745 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi

    Did you find any solution

  • Zhenyu Wang Profile Picture
    on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi Goutam,

    I have tried to inject the fetchxml into ListQuery.

    I do see the fetchxml is updated.

    However even I manually refresh the subgrid, nothing changed.

  • Suggested answer
    gdas Profile Picture
    50,089 Moderator on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi,

    Please check below old thread -

    community.dynamics.com/.../299697

  • Zhenyu Wang Profile Picture
    on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hi CRM Develope,

    Thank you for reply.

    However, did you ever read my questions...
    I already tried this plugin on 'RetrieveMultiple'. My issue is working in traditional Dynamics 365, but no in HUB

  • Suggested answer
    CRM Develope Profile Picture
    890 on at
    RE: In Hub, how to filter subgrid, using JavaScript or Plugin

    Hello,

    Please check below link:

    nishantrana.me/.../plugin-on-retrieve-multiple-in-crm-2015

    Thank you

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans