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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Custom Lookup Filter PreSearch Method not working

(0) ShareShare
ReportReport
Posted on by 5

Hi folks I ran through an error, i had custom entities HR and Employees, i'm using an presearch method to just 

simpy filter records in the lookup field to show only Employee whose name is Adnan.

Here is my sample code:

function filterLookupOnLoad(excutionContext) {
    var formContext=excutionContext.getFormContext();
  
        formContext.getControl("kamran_lookforemploye").addPreSearch(FilterLookup);
    
  
 }
 
 function FilterLookup(excutionContext) {
    var formContext=excutionContext.getFormContext();
   
    var fetchXML = ""  
                              ""  
                              "";
  
    formContext.getControl("kamran_lookforemploye").addCustomFilter(fetchXML);
 }
 

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    Try to use

        var fetchXML = ""  
                                  ""  
                                  "";

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 131 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 46 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 41

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans