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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Entity list - Search function happening before JavaScript

(1) ShareShare
ReportReport
Posted on by

Hello, 

I have created an entity list and page template for my Dynamics Portal, this entity list also uses the search function. I am attempting to search for a full name with just the surname. This is returning a result of 0 contacts. I have attempted to resolve this by adding some JavaScript to add the '*' wildcard.

This method only works on the second attempt due to the search function happening before the javascript adds the wildcard to the search.

Is there a way to delay the search or start the JavaScript first?

Thank you,

Joe.

*This post is locked for comments

I have the same question (0)
  • Jlavos Profile Picture
    345 on at

    Hi, having the same issue, have you found a solution for this?

  • Suggested answer
    Dmytro Rutkovskyi Profile Picture
    1,835 on at

    Hi, Can you specify your problem better?

    Here the several pieces of advice:

    1) If you doing something with entity list, you need wait until data is loaded, like:

    $(".entity-grid.entitylist").on("loaded", function () {
       //you code goes here
    });


    2) to apply search to the list - I think you can do it with metadata filters than you can use something like this to apply metadatafilter when enityt-list ready to update itslef:

    var entitygrid1 = $($("#entitylist1").find("div.entity-grid"));
    var entitygrid1_load = 0;
    $(document).ready(function(){
    
        entitygrid1.on("loaded", function () {
           entitygrid1_load ++;
            if (entitygrid1_load == 1)
            {
               $(this).trigger("metafilter",["0={{YOUR SEARCH STRING}}"]);
            }
       });
    });
    
    

    3) very obvious - just use some kind of timer to postpone search operation, like setTimeout(you_func_with_code_to_search, time_in_milliseonds);.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans