web
You’re offline. This is a read only version of the page.
close
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. 

I have the same question (0)
  • Suggested answer
    Mahendar Pal Profile Picture
    45,095 on at

    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.

  • Daniel Schumacher Profile Picture
    40 on at

    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?

  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    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

    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.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
Martin Dráb Profile Picture

Martin Dráb 47 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 38 Super User 2025 Season 2

#3
Pallavi Phade Profile Picture

Pallavi Phade 32

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans