Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Is there a supported Method to filter subgrid based on a main form lookup v9 online

Posted on by 507

In Dynamics 365 Online v9 is there a way to filter the subgrid data based on a lookup value from the main form that matchs a field on the subgrid line?

Ex: main form has lookup called "event". Main form has a subgrid of instructors, the subgrid line has the same field lookup "event".

When I select event on the main form; I would like the subgrid to filter the instructor list accordingly.

I see the javascript methods but they are unsupported.  Would like to do it properly if its at all possible?

*This post is locked for comments

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Scott,

    Do you have an example on how to achieve?

  • rthompson Profile Picture
    rthompson 1,530 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Carol,

    Did you come up with a way on how to resolve this issue?

    I have run into this problem.

    Thanks

  • Carol J Kelly Profile Picture
    Carol J Kelly 507 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Well now, doesn't that just suck! Thanks :) Cheers from Canada.

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Carol - unfortunately there is no reliable way of getting the context of the query on the server side and so a plugin doesn’t help here.

    Going forward the way to do this kind of thing will be using an embedded CanvasApp if it is really important to have this filtering (once embedding canvas apps reaches prime time!)

    Hope this helps

  • Carol J Kelly Profile Picture
    Carol J Kelly 507 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Thanks Scott. Your 100 percent right, I wont use unsupported as this is a biz solution, so I just deleted it LOL.  The quick create does work, except that I need use to selected records in the subgrid. I have a plugin running against the selected records.  I need to be able to filter the subgrid down from 100s of records to about 14-15 rows based on 3 lookup fields on main form. Then end user can select without searching endlessly and then plugin will do its magic.

    Is it possible to set the data returned to a subgrid using C# plugin? I was looking at threads on context.OutputParameters and post retrieve multiple plugin  but its not very clear.

    Ex: community.dynamics.com/.../236365 and nishantrana.me/.../plugin-on-retrieve-multiple-in-crm-2015 .

    Problem is I don't understand how the collection after its been filtered gets passed back to subgrid on CRM form? with what view?

  • ScottDurow Profile Picture
    ScottDurow 50,177 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    I would strongly discourage you from using the unsupported technique for filtering the lookup! The supported way is to create a manual intersect entity with a quick create form - you can then add filtering to the lookup on the form.

  • Suggested answer
    gdas Profile Picture
    gdas 50,085 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Carol,

    I have doubt , I dont think you can  pass additional lookup parameter from client side UI to filter grid , as you can change any time the filter. As shared by Mahendar above , this is OOB filter , you can get only the the filter criteria information inside plugin which has configure on the subgrid view.

    It is possible to validate some other entity records inside retrieve multiple plugin which are there in the database , let say you want to check user security role or some other related record value and add custom filter in the  retrieve multiple plugin. You can see here my article -

    goutamdascrm.wordpress.com/.../restrict-advanced-find-entity-record-based-on-security-role-using-retrieve-multiple-plugin

  • Suggested answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Carol,

    This should help you to do this using plugin: nishantrana.me/.../plugin-on-retrieve-multiple-in-crm-2015

    Check this thread as well :community.dynamics.com/.../236817

  • Carol J Kelly Profile Picture
    Carol J Kelly 507 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Goutam, is it possible to populate the subgrid using C# plugin? I can grab the data in an EntityCollection, filter it based on lookups(queryexpression) but I don't know how to repopulate or "set" the subgrid with the filtered data using existing view??

  • Carol J Kelly Profile Picture
    Carol J Kelly 507 on at
    RE: Is there a supported Method to filter subgrid based on a main form lookup v9 online

    Hi Goutam,  the third selection is my scenario in your blog and it does work. But I have to trigger javascript code on the subgrid event "OnRecordSelect", so quick view form not an option. I checked to see if events are available on the quick view subgrid :(   I will use the unsupported method in hopes that Microsoft some day figure out a supported one, its seems to be a feature everyone needs.

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans