Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Mapping multiple accounts to custom entity

(0) ShareShare
ReportReport
Posted on by 40

Hi,

I have a custom entity with two lookup field to the account entity. I need one primary and one secondary account and some additional information. Now when I create a new record from my custom entity table everything works fine. But when I create a new entry from the subgrid from account it will populate this account as primary and secondary account in my custom entity. 

Is there any possibility to populate only the correct field? Like primary account from primary account subgrid and secondary account only from secondary account subgrid? 

I see that both relationships have both mappings and I can't remove one mapping from the relationship. 

  • Daniel Schumacher Profile Picture
    40 on at
    RE: Mapping multiple accounts to custom entity

    Thanks. I thought of this solution but I hoped there is a solution in standard. I'll discuss this with the customer but I don't think that's the preferred way. So maybe I'll just clear both values on form load event and the customer has to add them again.

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Mapping multiple accounts to custom entity

    Hi,

    One possible options could be to customize Add New button on the sub grid and write code there to auto populate field based on your requirement. You need to have some logic which you can use from account entity to identity if it is primary or secondary.

    HTH

  • Daniel Schumacher Profile Picture
    40 on at
    RE: Mapping multiple accounts to custom entity

    But in a script/plugin/workflow I don't know if I open the create form as primary or seondary account. Or is there a way to know from which subgrid I opened the form?

  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at
    RE: Mapping multiple accounts to custom entity

    Hi,

    This is because of the default behavior of the System, but you can write scripting/plugin code or workflow on create to correct this and setup secondary field from the parent account based on the first lookup.

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

News and Announcements

Now Available: 2025 Release Wave 2

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Adis Profile Picture

Adis 136 Super User 2025 Season 1

#2
Sohail Ahmed Profile Picture

Sohail Ahmed 81

#3
Jonas "Jones" Melgaard Profile Picture

Jonas "Jones" Melgaard 77 Super User 2025 Season 1

Product updates

Dynamics 365 release plans