Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Problem with creating a lookup field in existing records

(0) ShareShare
ReportReport
Posted on by

Hello!

I have two entities A and B, with many records in them.

entity A has 1:N relationship with entity B

Inside of entity B, I've created a lookup field that display the corresponding primary key of entity A ( It directs me to the corresponding record in entity A when i click on them)

Problem:

I want to create a lookup field in entity A that display the corresponding primary key of entity B

As there're already many record in entity A, how can I do this so that the lookup field I create in entity A can automatically match to the corresponding primary key of entity B in each record?

Thanks in advance!

*This post is locked for comments

  • Verified answer
    RE: Problem with creating a lookup field in existing records

    I found the answer, Sub-grid is awsome. Thank you everyone!!

    community.dynamics.com/.../microsoft-dynamics-crm-2011-form-sub-grids

  • RE: Problem with creating a lookup field in existing records

    That is a good point, I can't do it since A and B have 1:N relationship. Can I add it to Entity A's form then? let it display as a table or something

  • Suggested answer
    Aric Levin Profile Picture
    Aric Levin 30,188 Moderator on at
    RE: Problem with creating a lookup field in existing records

    Seems like you are basically looking for a 1:1 relationship that will store the values of each other entity.

    There are not real 1:1 relationships, but you would be created a 1:N relationship in each one of the entities.

    There are a few ways to do this, but you will most likely create a plugin (or two), that will take the value from one field and update the other entity.

    On Update of Entity A Lookup

      Update Entity B with value of Entity A Record Id

    You have to be careful not to run into an endless loop, since each plugin message will call the other, so you will have to control the depth or parent message name and entity in the Parent Plugin Execution Context message.

    Hope this helps.

  • Verified answer
    RE: Problem with creating a lookup field in existing records

    Hi,

    Look-up doesn't work for Entity A to Entity B since there is 1:N relationship established. Keep the Entities with no relationship and Add the Look-up of the Entities. 

  • Verified answer
    Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: Problem with creating a lookup field in existing records

    Hello,

    Existing records can be updated by writing a console app or using excel (export/import) But the problem is - A and B have 1:N relationship, as there may be many child record for Entity A, but one lookup can show you only one child record what about if your entity A have more association with entity B records ??

    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans