Search code examples
dynamics-crmdynamics-crm-2013dynamics-crm-onlinedynamics-crm-2015

Filtering instances not related to the current contact


I have a custom entity Stuff and it contains a lookup to Contact. I created a 1:N relation with the latter as primary and the former as related entity.

On the Contact's form I added a subgrid and I only wish to list the instances of Stuff that have the lookup pointing to the currently viewed Contact. However, when I choose Only Related Records, the custom entity isn't in the list (despite it being related via the 1:N relation).

So, I'm using All Record Types, instead, but that shows all the instances of Stuff and not, as I wish, only those that are related to the currently viewed member.

So, what's the best course of action here? Should I do something with the relation? Or build a custom filter in JavaScript? How can I make the Stuff related to Contact if it's at all possible?

The image below shows the available conditions for the related entities. I notice that none of them relates to Contact, though. Do I need to activate it somehow or am I approaching it from a totally wrong angle?

enter image description here


Solution

  • So to give you more detail, you add the grid on the form: (This is coming from the contact Form edit, after you press add subgrid)

    enter image description here

    you select there only related records, this are the stuff record i created:

    enter image description here

    As you can see only 3 of them has a lookup pointing to a valid contact, from there if you look at the grid, is showing only the related ones as you selected during the grid creation:

    enter image description here

    In any case i update the answer this is how the relationship is defined, and is a simple lookup created from the stuff entity:

    enter image description here