Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Activity Subgrid with Regarding Child Entities

  • 1.  Activity Subgrid with Regarding Child Entities

    Posted Feb 06, 2019 02:17 PM
    I'm trying to create a subgrid on the account that will display open activities, this also gives the ability to easily schedule a new activity without going to a separate screen.

    Only issue is, it will only list the activities where the account is the regarding field on the activity. If the activity is regarding any child records or related (child accounts, contacts, opportunities, etc) it won't show up on the subgrid.

    I found this solution https://community.dynamics.com/crm/b/cinterosab_crmblog/archive/2016/04/26/show-all-related-activities-in-a-subgrid

    However that only works if the account is referenced somewhere on the activity. I still can't see any activity that is regarding a child or related record.

    Has anyone found a way to make this work? I essentially want the subgrid to list the same activities that would be listed on the Open Activity Associated View.

    Any ideas would be greatly appreciated!

    ------------------------------
    Matthew Skowron
    HUB Industrial Supply
    ------------------------------
    Conference-CRMUG_200x200


  • 2.  RE: Activity Subgrid with Regarding Child Entities

    TOP CONTRIBUTOR
    Posted Feb 07, 2019 12:49 AM
    Did you install this plugin and test it? I have not taken the time to fully comprehend what is in the linked article, but it seems to me that in order to get what you want, you would have to build a recursive plugin that traverses a parent-child tree of relations in order determine which ones to pull in. Are you on-prem? It has been a very long time since I have looked under the SQL hood of CRM (not since 2013) and I would bet that they have some optimized views for that.

    ------------------------------
    Nelson Johnson
    Solution Architect
    BroadPoint Technologies, LLC
    Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------

    Conference-CRMUG_200x200


  • 3.  RE: Activity Subgrid with Regarding Child Entities

    Posted Feb 07, 2019 10:45 AM
    Yes I am on prem. The plugin essentially updates the subgrid to link against activity party as appose to the activity's regarding field. So then the subgrid will list any activity where the account is a mentioned as a party on the activity. Like a recipient, customer, sender, attendee, etc. It's just missing Activities on child relationships. I'll have to check out the SQL Views and see what I can figure out.

    ------------------------------
    Matthew Skowron
    HUB Industrial Supply
    ------------------------------

    Conference-CRMUG_200x200


  • 4.  RE: Activity Subgrid with Regarding Child Entities

    SILVER CONTRIBUTOR
    Posted Feb 07, 2019 01:08 PM
    Edited by Allison Walters Feb 07, 2019 01:09 PM
    I've used/modified Jonas's solution heavily, for a variety of purposes.

    Basically what it does is hook into the requestmultiple step that is called when you're loading a view/subgrid, and uses impossible conditions within special views to tell the code that this is a situation where you want to do modifications.  Then it modifies the underlying fetchXML for the query.  I don't know how SQL views will come into play when dealing with fetch, or if they even do at all.  And the views definitely run off of fetch...

    I'd suggest trying out a fetchXML builder like in XRMToolbox to see if you can create a fetch query that gives you what you're looking for, and as importantly, see how long it takes to run.  If you can get something that works ok, the builder in XRMToolbox actually has an option to translate that to C#.  It won't mesh exactly with Jonas's code, but from the two halves you can piece together something that works in the way his does, but uses your query modifications instead (or in addition to) his.

    I should say, though, it potentially brings up other complications.  Like if you're on a parent record, but you're seeing everything from child records - how do you tell which you're looking at?  When you hit the plus sign to add, what do you expect to happen?  Etc.  I've got a post about some challenges I faced with this here:  https://community.dynamics.com/crm/f/117/p/293538/843090

    ------------------------------
    Allison Walters
    IT Coordinator
    Centre for Affordable Water and Sanitation Technology
    Calgary AB
    ------------------------------

    Conference-CRMUG_200x200


  • 5.  RE: Activity Subgrid with Regarding Child Entities

    Posted Feb 11, 2019 02:38 PM
    Thanks for the response Allison, it's super helpful.

    I've been playing around with the fetchXML builder on XRMToolbox. I was looking at the fetchXML behind the associated views and those are wide open so it looks like Dynamics does something different with those.

    When you did your project on this did you run into any issues with child entities and contacts or did adding the link to actvitiyparty just work for you? I'm thinking I'm going to have to link all the other entities but I was hoping there was an easier way.

    ------------------------------
    Matthew Skowron
    HUB Industrial Supply
    ------------------------------

    Conference-CRMUG_200x200


  • 6.  RE: Activity Subgrid with Regarding Child Entities

    SILVER CONTRIBUTOR
    Posted Feb 11, 2019 02:50 PM
    Strange - replied but not seeing it.  Apologies if it comes up twice.  Anyway, I was able to link only to activity party, not each individual activity entity.

    ------------------------------
    Allison Walters
    IT Coordinator
    Centre for Affordable Water and Sanitation Technology
    Calgary AB
    ------------------------------

    Conference-CRMUG_200x200


If you've found this thread useful, dive deeper into User Group community content by role