Skip to main content

Notifications

Announcements

No record found.

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. 

  • 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
    Mahendar Pal 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

  • 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
    Mahendar Pal 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

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,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans