Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Associated view brainteaser (connections, references)

(0) ShareShare
ReportReport
Posted on by

Dear all,

I have the following situation: On the one hand Entity X has a lookup ref to Account (main type) and on the other hand Entity X has connections with Account (support type). Entity X is needed since it hold extra information and synchs with an external system.

What I'd like to achieve is to create a sub-grid (associated view) on the Account form (from main type perspective) which for the references from Entity X shows the connections with Accounts (from support type).

It was easy to create an advanced find query for Connections and get the relevant info but then the Account of Main type is needed as parameter and I somehow would like this parameter to be the account which is loaded on the form. Furthermore, I tried making an advanced find query for Entity X but when I try to add columns to the view, the ones for Record type Connection From/To are not available so I think that I might be hitting some limitation.

My question is if what I try to achieve is actually possible with the what Dynamics provides as out-of-the-box :)

Cheers

Vassil

*This post is locked for comments

  • Vassil Profile Picture
    Vassil on at
    RE: Associated view brainteaser (connections, references)

    Hi Aiden,

    We decided to design an extra entity instead of doing the JavaScript trick since we do not get any guarantees if it will work with the next release. And in the comments of the blog post there are quite some reactions regarding the correct syntax.

    Regards

    Vassil

  • Aiden Kaskela Profile Picture
    Aiden Kaskela 19,694 on at
    RE: Associated view brainteaser (connections, references)

    Hi Vassil,

    Did you have any luck with this?

    Thanks,

     Aiden

  • Verified answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,694 on at
    RE: Associated view brainteaser (connections, references)

    Hi Vassil,

    Thanks for the clarification. If you're having trouble getting a view to work with a filter for the main account, I know that you can add javascript to set the query on the grid. It's not exactly supported, but it's not invasive either. Here's details on how you'd do that: joshimandarblog.wordpress.com/.../crm-2015-applying-custom-fetchxml-to-a-subgrid-using-javascript

    The easiest way to implement that is to build a query in advanced find to get back the records you want for "Account A", then export the FetchXml and put that in your javascript as your query. then all you need to do is replace the "Account A" ID in the query with the ID of the record you're on, and you'll be good to go.

    Let me know how it goes. If this helps I'd appreciate if you marked this as Answering your question.

    Thanks,

     Aiden

  • Vassil Profile Picture
    Vassil on at
    RE: Associated view brainteaser (connections, references)

    This is how the setup looks like:

    schema.png

    Basically in the form of Account (Main Type) I would like to have a sub-grid with all Accounts of Support Type.

  • Vassil Profile Picture
    Vassil on at
    RE: Associated view brainteaser (connections, references)

    Hi Aiden,

    This is the correct setup. I have just one clarification: the 2 references to Account are actually to different account objects. Otherwise what you have described is exactly what I have also tried myself but this is not yet the solution.

    Cheers

    Vassil

  • Suggested answer
    Aiden Kaskela Profile Picture
    Aiden Kaskela 19,694 on at
    RE: Associated view brainteaser (connections, references)

    Hi Vassil,

    Quick question - is this your entity setup (arrow is a lookup):

    data-source.png

    And on the account form, you want a grid of Connections that are related to an Entity X ?

    If that's what you're looking for, it's easy to do and a good example is on the opportunity form (Sales Team, Stakeholders, etc), which are showing only some connections. Here's what you want to do:

    1. Set up a new System View on Connections. The filter for the view should be "Type (To)" Equals "Entity X"
    2. On the Account form, add a subgrid for Connection
    3. Edit the properties of the grid and go to Data Source. 
      1. Records should be Only Related Records
      2. Entity = Connections (Connected From)
      3. Default View should be the view you created in Step 1
      4. There are other options on if you want the user to change the view or not, but it's not going to impact this.

    Here's a screenshot from the Opportunity, yours should be very similar:

    data-source.png

     

    Let me know how this goes. If it helps I'd really appreciate if you'd mark this as Answering your question.

     

    Thanks,

      Aiden

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

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,969 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,846 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans