Skip to main content

Notifications

Sales forum
Suggested answer

Customer Data Type

Posted on by
 Hi Community,
 
 
I am facing  one issue   that is for customer data type field  i need to restrict  to select one type of account  records   (for account entity  2 types of accounts are there ).
 
How can i solve this issue please guide me.
Categories:
  • Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Customer Data Type
    Hi,
     
    Has the issue been solved?
    Have there been any updates? Please feel free to ask me if you have any questions!
    If it has been resolved, can you mark the response as an answer?
  • Suggested answer
    Dengliang Li Profile Picture
    Dengliang Li Microsoft Employee on at
    Customer Data Type
    Hi,
     
    You can use JS to restrict the Customer Look up field from displaying contact or account records.
     
    function onload(executionContext) {
        //get customer field control        
        var customerId= executionContext.getFormContext().getControl("customerid");
            function filterCustomerLookup() {
                //Set the Customer field to display only account records.To display the contact record, simply replace account with contact.
                customerId.setEntityTypes(["account"]);
                }
               
                customerId.addPreSearch(filterCustomerLookup);
        }

     
    Best Regards,
    Dengliang Li
     

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,107 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,954 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans