Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Customer field behaviour - multiple customer fields on same record

Posted on by 719

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

  • K.Wise Profile Picture
    K.Wise 25 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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.

  • AriaConsulting Profile Picture
    AriaConsulting 2,655 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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.

  • Inksrm Profile Picture
    Inksrm 719 on at
    RE: Customer field behaviour - multiple customer fields on same record

     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
    AriaConsulting 2,655 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Customer field behaviour - multiple customer fields on same record

    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
    AriaConsulting 2,655 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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.

  • Inksrm Profile Picture
    Inksrm 719 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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
    AriaConsulting 2,655 on at
    RE: Customer field behaviour - multiple customer fields on same record

    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.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans