Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

2 Relationships in one entity

Posted on by 220

Hi,

I am trying to do a relationship based on 1 field information.

I currently have 2 entities: 

-Policy Numbers

-Insured Cars . To add an insured car I have used a look up field based to Policy Number, so that all insured cars are associated with Unique policy Number.

I have also created a new entity INSURED DRIVERS and what I want to do now is to add drivers that associate with policy numbers and insured cars.  To add a driver I would like to select a Policy number and Choose a CAR related to Policy number.

I have managed to get the first part done, add driver on Policy number, but I am not sure how I could choose a related car associated to the Policy number.

Each driver needs to be assigned to a policy number and CAR.

Many THanks in advance

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: 2 Relationships in one entity

    Yes, that is bug from CRM. What you can do as a fix is, write a java script which clears the Car lookup whenever Policy number changes. This way user has to select Associated Car everytime policy is changed

  • Verified answer
    Mouncif Profile Picture
    Mouncif 91 on at
    RE: 2 Relationships in one entity

    Hello,

    I think you should relate your entity Driver to Insured Cars, the Driver will be an intermediate entity between InsuredCars and PolicyNum : 

    so you can use a lookup fields, but you should add Js Custom code to filter PolicyNum according to CAR. 

    Hope this will help !! 

  • Verified answer
    Rasi Profile Picture
    Rasi 220 on at
    RE: 2 Relationships in one entity

    This worked . Many Thanks, one more question, What I have noticed is when I select policy Number then all related cars appears, which is good. But if I change the policy number ( lets say choose one by a mistake) the car remains in the field from previous Policy numbers.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: 2 Relationships in one entity

    Hi Rasi, You can do this with an out of the box feature of Related records filtering. Add a lookup of Policy Number and Cars on the form. In the properties of Cars lookup field, check the Related record filtering and select Only show records where Policy Numbers entity.

    Here is the sample screenshot : 67053.Capture2.PNG

    Hope this helps. 

    Thanks!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans