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 :
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

I have the same question (0)
  • Suggested answer
    CRM Develope Profile Picture
    894 on at

    Hello,

    Please check below link:

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

    Thank you

  • Zhenyu Wang Profile Picture
    on at

    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
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Please check below old thread -

    community.dynamics.com/.../299697

  • Zhenyu Wang Profile Picture
    on at

    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.

  • MMK Profile Picture
    745 on at

    Hi

    Did you find any solution

  • Suggested answer
    MMK Profile Picture
    745 on at

    Hi All

    here I have solution that works for both UCI and Classic

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

  • rthompson Profile Picture
    1,532 on at

    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 = ""
                  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                //  ""
                  ""
                  ""
                  ""
                  ""
                  ""
                  "";

  • rthompson Profile Picture
    1,532 on at

    This link works great.

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

    I had to change my condition uinname and value around.

      ""
      ""

  • RHOU Profile Picture
    65 on at

    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

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 > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans