Skip to main content

Notifications

Announcements

No record found.

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);
 }
 

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at
    RE: Custom Lookup Filter PreSearch Method not working

    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

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Holly Huffman Profile Picture

Holly Huffman 103

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 96 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 51 Most Valuable Professional

Product updates

Dynamics 365 release plans