Issue 1 ) we search for expert with 0Data query, but it display only last 2 result out of 50 result , as it add extra $skiptoken parameter and 2 query automatically runs in background from CRM.
for above issue I use $.append() so that all results display appends to each other and complete result show on the page , but it generate other issue.
Isseu 2 ) As we use `.appned()` so next time we hit the search button it will append the result with previous search result.
How to get rid off this issue?
below is relevant code
var searchHit =0;
$(document).on('click','#searchExpert', function(){
var term = $.trim($('#term').val());
if(term == null || term == '') {
alertbox('Please search some value');
} else {
searchHit++;
searchExpert(term);
}
} );
var searchExpert = function (searchTerm) {
$('#results > tbody').empty();
SDK.JQuery.retrieveMultipleRecords(
"new_expert", null ,
function(experts) {
//console.log(experts);
if (experts.length != null && experts.length > 0 ) {
var content = ""; // here we create html
//console.log(content);
if(searchHit === 1) {
$('tbody', '#results').append(content);
} else {
$('tbody', '#results').html(content);
}
}
}, errorHandler, function() {
// on complete handler
$('#loading').fadeOut(1000);
}
);
}