Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Suggested answer

Custom Lookup Filter PreSearch Method not working

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

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

    Hello,

    Try to use

        var fetchXML = ""  
                                  ""  
                                  "";

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,126 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans