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
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);.
Hi, having the same issue, have you found a solution for this?
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156