web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

Customer field behaviour - multiple customer fields on same record

(0) ShareShare
ReportReport
Posted on by 721

Hi all, 

Wanting to confirm if the following behaviour of the Customer field is expected. 

We have multiple Customer type fields in a custom entity. 

When we create a new record the Customer fields are all blank and we are able to lookup to different Accounts or Contacts (which is what we want). 

When we create a new record from the subgrid on the Account form, all of the customer fields are populated with that same Account. Is that expected behaviour? I've tried looking into the mapping on the relationships to see if there's any way to stop this happening but can't seem to find a way. We just want one of the Customer fields to be populated with that Account, is there a way to do this? 

Thanks

I have the same question (0)
  • AriaConsulting Profile Picture
    4 on at

    As this is a customization, can you share screenshots to help us better understand what you have built, and how.  That would make it easier to try to help.  Picture...thousand words and all that.

  • Inksrm Profile Picture
    721 on at

    Hi AriaConsulting

    We've configured multiple Customer and Account lookups from a custom entity. 

    We find that when we create a new record of our custom entity from a subgrid on the Account form, all Customer and Account lookups are populated with that same Account (even the ones that aren't on the quick create form). As you can see in the screen shot below, a New record has been created from an Account subgrid, but all 3 lookups are populated with that same account. We only want the first one to be populated. 

    pastedimage1628036404517v1.png

    I'm wanting to know if this is expected behaviour and is there a way to stop this auto-population of all the other Customer and Account lookups?

  • AriaConsulting Profile Picture
    4 on at

    It really depends on HOW you've defined those relationships.  All I can see in the screenshot is the result, not necessarily the cause as I don't know how exactly those entities have been extended nor how the lookup is driven.

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    You can add a onload event on your Quick Create Form and set the value of those fields to null.

    Something like this:

    function formOnLoad(executionContext){
        var formContext = executionContext.getFormContext();
        formContext.getAttribute("yourfield").setValue(null);
    }

  • AriaConsulting Profile Picture
    4 on at

    Steve,

    Not sure, but it didn't sound to me like the question was how to nullify the fields.  That would seem to kind of negate the purpose of creating them in the first place.  Which seems a bit silly.  The way I interpreted the question was to find out WHY the values were being filled in and then stop that behaviour.  But, I may have read it wrong.  If the need is to simply set the values to null then I'm sure your approach will be good.

  • Inksrm Profile Picture
    721 on at

     Hi Steve and Lorne.

    Thanks for your suggestions. 

    Lorne is right, in that I'm wanting to know why the fields are all being populated, if that is expected behaviour, and also if I can stop it from happening.

    Steve, part of the issue is that it is also populating the other account and customer lookups on the main form that aren't even on the quick create. With your solution I would need to add all of those fields to the quick create as hidden fields so that I could apply your javascript to null out the values.

    The goal is to have them null so that the user can populate them from the main form with different account records, but ideally if there is a way to stop this behaviour out of the box I'd like to do that rather than applying javascript.

  • AriaConsulting Profile Picture
    4 on at

    Thanks for the confirmation.  So, to try to help towards that, we need to see how those entities are setup, the relationships, the lookups, and if there is any code/script of any sort involved.  Oh, and do you actually want the values to be set to "null" or do you want them to be empty?  Since null and empty aren't necessarily the same.

  • K.Wise Profile Picture
    25 on at

    Hi,

    Did you get a resolution to this? I am trying to use multiple listparts (sales lines) on one page with a header and I am having the same issue.

    I have tried this in the current document as well as a new listplus page.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

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

#1
11manish Profile Picture

11manish 77

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 45 Super User 2026 Season 1

#3
sannavajjala87 Profile Picture

sannavajjala87 29

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans