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)

SubGrid display related records using two fields on related entity

(0) ShareShare
ReportReport
Posted on by

Vanilla Dyanmics allows me to set a subgrind on a record, account, to show all incidents related through a field, Customer.  I want to be able to using that same sub grid, also show records where that related account is also listed in a custom field on the incident record, End User.  

It's the same related entity, just a second field to look at.  Cases(End User).  My other option is two grids, which I'd prefer not to do.

Is this as simple as exporting the solution and just tweaking the xml?  Not sure if anyone has done this before already, and if there is an easier way.  Or if even tweaking the code will work.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    7673.Capture.JPG

  • Verified answer
    awalters Profile Picture
    3,079 on at

    Your scenario is a bit different than mine, so there may indeed be a simpler way to handle it (maybe a solution tweak, like you suggest).  I can point you at a way that would work, but takes some development experience and would potentially be overkill if there actually is an easier way to handle it.  :-)

    Essentially, what you can do is have a plug-in that intercepts the query being used to populate the subgrid and modifies it before sending it onwards.  Jonas Rapp gives an example (plus a sample solution and source code) here - http://jonasrapp.innofactor.se/2016/04/all-activities.html

    I was able to use this (and the part 2 companion article) to create a subgrid for activities that shows activities an account is directly tagged in, or ones they're linked to via a separate custom entity we've created.  So it does feel like you'd be able to make it work for your case as well.  I've played with plugins a bit, so with his sample code it wasn't too bad - only took a couple hours to modify the code.  Actually took longer to figure out the fetchXML, because I wasn't familiar with Fetch, and there are a variety of limitations around joins, etc...  But your query seems less complex, since you're just working with a custom field on the same entity, rather than an additional entity altogether.

  • Community Member Profile Picture
    on at

    [quote user="Allison Walters"]

    Your scenario is a bit different than mine, so there may indeed be a simpler way to handle it (maybe a solution tweak, like you suggest).  I can point you at a way that would work, but takes some development experience and would potentially be overkill if there actually is an easier way to handle it.  :-)

    Essentially, what you can do is have a plug-in that intercepts the query being used to populate the subgrid and modifies it before sending it onwards.  Jonas Rapp gives an example (plus a sample solution and source code) here - http://jonasrapp.innofactor.se/2016/04/all-activities.html

    I was able to use this (and the part 2 companion article) to create a subgrid for activities that shows activities an entity is directly tagged in, or ones they're linked to via a separate custom entity we've created.  So it does feel like you'd be able to make it work for your case as well.  I've played with plugins a bit, so with his sample code it wasn't too bad - only took a couple hours to modify the code.  Actually took longer to figure out the fetchXML, because I wasn't familiar with Fetch, and there are a variety of limitations around joins, etc...  But your query seems less complex, since you're just working with a custom field on the same entity, rather than an additional entity altogether.

    [/quote]

    Not too shabby.  This looks like it will work.  I was hoping not to have to write a plugin as a direct code edit would be less resources on the page, but looks like it directly will solve my issue.  I'll keep digging, but it's nice to know this will get me where I need to be.  Thanks.

  • awalters Profile Picture
    3,079 on at

    No problem!  And if you find something simpler, definitely link back to it here - I'd be curious if it would work for our scenario as well.  :-)

  • Community Member Profile Picture
    on at

    Hi
    I have custom entity.

    I want to show the sub grid with with filtering two or three fields that all are look up.
    In SQL way I want to select * from table where field 1 = *** or field 2=*** or filed 3 =***

    I read your post it was similar to my issue did you find any answer to to your post?

    would you share your info and help me to solve this?

  • Community Member Profile Picture
    on at

    I did not find an easier way.  Allison's way should work, just follow her suggestion.  I did not try it yet as priorities were shifted here to something else.

  • Bahalzamon Profile Picture
    2 on at

    Looks like the link no longer works, dug around and I think this is the correct URL now: jonasr.app/.../  as the month/year and name are pretty much right on. :)

    Unfortunately it looks like he removed all the images or most likely they got re-pathed and not updated.

    I am going to still attempt to try this, but if you happened to find an easier way please let me know. I went to the site and watch an hour long zero to hero video that I learned nothing I didn't figure out by poking around int he Toolbox plugin. :(

  • Suggested answer
    Abdul Wahab Profile Picture
    12,119 Moderator on at

    Hi Clinton Booze,

    You should need to create a question in the forum with your details. 

  • Bahalzamon Profile Picture
    2 on at

    Why am I needing to create a question? Create a duplicate question? That is usually frowned upon...

    I am providing an update URL for a "Verified" answer in an attempt to help other people experiencing the same issue.

  • Bahalzamon Profile Picture
    2 on at

    Why am I needing to create a question? Create a duplicate question? That is usually frowned upon...

    I am providing an update URL for a "Verified" answer in an attempt to help other people experiencing the same issue.

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