how to modify search results display in service portal?

mrswann
Kilo Guru

find_real_file.png

how can we bring through the ticket short_description into the search results?

1 ACCEPTED SOLUTION

larstange
Mega Sage

Hi



You will have to modify the Typehead Search widget in the place where it saves the "label" of the record it finds



find_real_file.png


View solution in original post

4 REPLIES 4

larstange
Mega Sage

Hi



You will have to modify the Typehead Search widget in the place where it saves the "label" of the record it finds



find_real_file.png


ah briliant, so just to check - should be something like



rec.label = gr.getDisplayValue() + " " + gr.short_description;


larstange
Mega Sage

Do it like



rec.label = gr.getDisplayValue() + " " + gr.getValue(short_description);



Otherwise all results will get the same short description as it gr.short_description will save a reference for the gliderecord instead of the field value.



just remember that this function is generic for all tables that you add in sp_search_group.


So don't go adding a table which does not have a short_description field


mrswann
Kilo Guru

yes this works!! thank you




so it seems I need to create a couple of clones of the widget, and have one which if over certain chars truncates the short description (if so, maybe add an ellipsis??)



but the homepage view which has more browser real estate probably not necessary..