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 :
Customer experience | Sales, Customer Insights,...
Answered

Hide selecting Contact for potential customer when creating quote

(1) ShareShare
ReportReport
Posted on by 3,317
Hi All
When creating a quote account and contacts appear for selection. Is it possible to hide the contacts so only accounts can be selected as potential customer?
I have the same question (0)
  • Verified answer
    Muhammad Shahzad Shafique Profile Picture
    2,606 Most Valuable Professional on at
    function filterLookup(executionContext) {
        var formContext = executionContext.getFormContext();
        var customerAttr = formContext.getAttribute("customerid");
        customerAttr.controls.get(0).addPreSearch(function() {
            var fetchXml = `
            <filter>
                <condition attribute="parentcustomerid" operator="null" />
            </filter>`;
            customerAttr.controls.get(0).addCustomFilter(fetchXml);
        });
    }
     
     

    Option 2: Field Security

     

    Go to Settings > Customizations > Customize the System

     
     

    Navigate to Entities > Quote > Fields

     
     

    Find the Customer field and edit its properties

     
     

    Under Controls, configure the lookup to only show accounts

     
  • Samantha73 Profile Picture
    3,317 on at
    Tried field properties but no option to select views
  • Suggested answer
    ManoVerse Profile Picture
    1,221 Super User 2026 Season 1 on at
    platform does not provide any true out‑of‑the‑box  setting or property to restrict a Customer lookup to only Accounts. you can simply write a JS like below on onload of the form:
    function onLoad(executionContext) {
        var ctrl = executionContext.getFormContext().getControl("customerid");
        if (ctrl && ctrl.setEntityTypes) {
            ctrl.setEntityTypes(["account"]); // Only Accounts allowed in the lookup UI shown below
        }
    }
     
    Note: this will not restrict to push the contact in this lookup by backend but UI will only show accounts.
     
     

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 Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 140 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
Abhilash Warrier Profile Picture

Abhilash Warrier 70 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans