web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

2 Lookups to same entity

(0) ShareShare
ReportReport
Posted on by 229

Hello! 

I'm currently implementing some custom tables so we can manage our Stories and Epics, and I'm having issues with the Relationships in between Stories.

Epics are Stories with "Is Epic" == Yes
Stories can have a reference to an existing Epic (=Story)
Stories can ALSO have a reference to it's predecessor story, e.g. "Fields on Release entity" might have a follow-up story "Additional fields on Release entity".
There're 2 subgrids on the Story, one for each relationship type.

After I've set up these relationships all seems fine except for adding new stories from a subgrid:
Let's say I'm on Story A and want to create a successor story - I click on the + in my subgrid, a new form opens where I can enter the new story, but Story A is automatically referenced in both "Epic" and "Predecessor" - I'd only want it to be referenced as one or the other, depending on which grid I clicked the "+".

What's the best solution to get there? 

*This post is locked for comments

I have the same question (0)
  • Ummacrm Profile Picture
    270 on at
    RE: 2 Lookups to same entity

    I think this may need some clarification:

    It would be easier if you pulled out the whole story/epic/etc, and simply used CRM terminology:

    Epics are Stories with "Is Epic" == Yes

    EntityA categorizes records via a new_fieldA

    Stories can have reference to an existing Epic

    EntityA records can reference other Entity A records via lookup(1:N, N:N?)

    This way it is less difficult to understand your design as Epic/story/Fields-on-release, etc are all part of your business, not part of the technology.

    EntityA are seperated into two categories
     CategoryA
     CategoryB (defined by a field on the record (new_Category)
     
    Records can also have references to other records via a custom 'intersect' entity which holds information about 2 different records from EntityA.  We are calling this IntersectA

    I have 2 subgrids on EntityA
     One for each relationship Type
      !!Please define this! do you mean that each category is seperated per subgrid, as in EntityA records are simply filtered?  Do we have a lookup to another EntityA record from an existing EntityA record?  Or does this reference the 'intersect' entity that holds information between two records?
      
    We are now assuming the subgrids seperate records based on the Category's listed initially then:
     When I click on the 1 of the subgrids (how is the subgrid setup? what are the filtering options or relationship?) a new form opens and I can enter in a new EntityA record  
      !!This is probably not what you are communicating- are you entering in a new EntityA records from an existing EntityA record?  Or is this subrid pointed at the IntersectA?
      


    Thanks!

  • DKasp Profile Picture
    229 on at
    RE: 2 Lookups to same entity

    sorry, I was way too deep into my own build there, I can see how that was very confusing. let me try again:

    I have an EntityA that has two relationships to itself (LookupA and LookupB), and there are two subgrids on the form, GridA shows any EntityA records related to the current record via LookupA, and GridB shows any EntityA records related to the current record via LookupB.

    The subgrids are, for lack of a better description, "standard" - I've not done anything to it except for adding them to the form and setting each up so it uses the corresponding Lookup field (LookupA for GridA, LookupB for GridB).

    When I go to one of the two grids and try to add a new record through it (which opens a dialog to enter a new EntityA), both LookupA and LookupB are preset to the current EntityA record. What I want to achieve is that when you want to add a record through GridA, it'll only populate LookupA in the new EntityA automatically, and if you go through GridB it'll only populate LookupB.

  • Verified answer
    Arun Vinoth Profile Picture
    11,615 Moderator on at
    RE: 2 Lookups to same entity

    To be clear, you are using subgrid of same entity, but different instances so the ribbon (+) button is same for both and command is same.

    Unless you do some unsupported to send parameter to differentiate using querystring in openEntityForm, this is not possible to implement.

  • DKasp Profile Picture
    229 on at
    RE: 2 Lookups to same entity

    Yes, it's all on one and the same Entity.

    I'd rather stay away from something unsupported, so I'll have to rethink my design and probably split it up into two different entities, that'd avoid the issue entirely and should still satisfy the requirements I have.

  • DynamicsTeam Profile Picture
    5 on at
    RE: 2 Lookups to same entity

    Hey,

    This is happening again on dynamics onPremise 9.1.10,

    The problem is that we cannot identfity on onload which mapping from the two is invalid,

    Any ideas?

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans