Good morning everyone!
I need to edit in Portal: Customer Service - Support Home.
Currently I have a portal with which several Customers work and I need the Global Search to filter by customer belonging to the logged in contact.
I have revised the standard configuration and due to design limitations it cannot be done.
I thought that with a fetch I could add the filter, I have the fetch, but I don't know how to modify the code in the web template, nor how to fill in the list of results that the template shows.
Template Web code:
{% extends 'layout_1_column' %}
{% block main %}
{% include 'page_copy' %}
{% assign created = request.params['created'] %}
{% if created %}
<div class='alert alert-block alert-success alert-case-created'><p>{% editable snippets 'CustomerService/Support/A_Case' type: 'text', default: resx['CustomerService_Support_A_Case'], escape: true %}{{ created | h }}{% editable snippets 'CustomerService/Support/CaseCreated' type: 'text', default: resx['CustomerService_Support_Case_Created'], escape: true , tag: 'span' %}</p></div>
{% endif %}
<div class="case-deflection">
<div class="content-panel panel panel-default">
<div class="panel-heading">
<span aria-hidden="true" class="fa fa-search"></span> {% editable snippets 'CustomerService/Support/HelpQuestion' type: 'text', default: resx['CustomerService_Support_Help_Question'], escape: true , tag: 'span'%}
</div>
<div class="panel-body">
<div class="input-group">
<div class="input-group-btn search-clear-container">
<button type="button" class="btn btn-default search-clear" title="{{ snippets['CustomerService/Support/ClearButton'] | default: resx['CustomerService_Support_ClearButton'] | h }}">
<span aria-hidden="true" class="fa fa-times"></span>
</button>
</div>
<input aria-label="{{ snippets['CustomerService/Support/HelpQuestion'] | default: resx['CustomerService_Support_Help_Question'] | h }}" title="{{ snippets['CustomerService/Support/FailedLogin'] | default: resx['CustomerService_Support_FailedLogin'] | h }}" type="text" class="form-control subject case-deflection" data-container=".case-deflection" data-target="#case-deflection-topics" data-template="#case-deflection-results" data-itemtemplate="#case-deflection-results" data-case-deflection-pagesize="5" data-case-deflection-logicalnames="knowledgearticle,incident,adx_issue,adx_webpage,adx_communityforumthread,adx_communityforumpost,kbarticle" data-case-deflection-query="" data-case-deflection-filter="" data-noresultstext="{{ snippets['CustomerService/Support/NoResults'] | default: resx['CustomerService_Support_NoResults'] | h }}" placeholder="{{ snippets['CustomerService/Support/FailedLogin'] | default: resx['CustomerService_Support_FailedLogin'] | h }}" />
<div class="input-group-btn">
<button type="button" class="btn btn-default search-apply" aria-label="{{ snippets['CustomerService/Support/SearchButton'] | default: resx['CustomerService_Support_SearchButton'] | h }}" title="{{ snippets['CustomerService/Support/SearchButton'] | default: resx['CustomerService_Support_SearchButton'] | h }}">
<span aria-hidden="true" class="fa fa-search"></span>
</button>
</div>
</div>
</div>
<ul class="list-group" id="case-deflection-topics"></ul>
<div class='panel-footer paging clearfix'>
<button type="button" class="btn btn-default search-more pull-right"><span class='fa fa-plus'></span>
{% editable snippets 'CustomerService/Support/ShowMore' type: 'text', default: resx['CustomerService_Support_ShowMore'], escape: true, tag: 'span' %}</button>
</div>
</div>
</div>
{% if user %}
{% include 'entity_list' key:page.adx_entitylist.id %}
{% else %}
<div class='alert alert-block alert-info'><p><span class='fa fa-info-circle'></span>{% editable snippets 'CustomerService/Support/SignIn' type: 'text', default: resx['CustomerService_Support_PleaseSignIn'], escape: true, tag: 'span' %}</p></div>
{% endif %}
{% raw %}
<script type="text/javascript">
(function ($) {
$(document).ready(function () {
setTimeout(function() {
$(".alert-case-created").slideUp(100);
}, 5000);
});
}(jQuery));
</script>
<script id="case-deflection-results" type="text/x-handlebars-template">
{{# each items}}
<li class="list-group-item">
<h4 class="list-group-item-heading"><a href="{{ url }}">{{ title }}</a></h4>
<p class="list-group-item-text search-results fragment">{{{ fragment }}}</p>
<div>
{{#label entityLogicalName 'adx_communityforum'}}
<span class='label label-info'>{% endraw %}{{ resx['Forums_Label']}}{% raw %}</span>
{{/label}}
{{#label entityLogicalName 'adx_communityforumthread'}}
<span class='label label-info'>{% endraw %}{{ resx['Forums_Label'] }}{% raw %}</span>
{{/label}}
{{#label entityLogicalName 'adx_communityforumpost'}}
<span class='label label-info'>{% endraw %}{{ resx['Forums_Label'] }}{% raw %}</span>
{{/label}}
{{#label entityLogicalName 'adx_event'}}
<span class='label label-info'>{% endraw %} {{ resx['Events_Label'] }} {% raw %}</span>
{{/label}}
{{#label entityLogicalName 'adx_eventschedule'}}
<span class='label label-info'>{% endraw %} {{ resx['Events_Label'] }} {% raw %}</span>
{{/label}}
{{#label entityLogicalName 'adx_issue'}}
<span class='label label-danger'>{% endraw %} {{ resx['Issues_Label'] }} {% raw %}</span>
{{/label}}
{{#label entityLogicalName 'incident'}}
<span class='label label-success'>{% endraw %} {{ resx['Resolved_Cases_Label'] }} {% raw %}</span>
{{/label}}
{{#label entityLogicalName 'kbarticle'}}
<span class='label label-primary'>{% endraw %} {{ resx['Knowledge_Base_Label'] }} {% raw %}</span>
{{/label}}
{{#label entityLogicalName 'knowledgearticle'}}
<span class='label label-primary'>{% endraw %} {{ resx['Knowledge_Base_Label']}} {% raw %}</span>
{{/label}}
</div>
</li>
{{/each}}
</script>
{% endraw %}
{% endblock %}
My fetchxml:
<?xml version="1.0"?>
-<fetch distinct="false" mapping="logical" output-format="xml-platform" version="1.0">
-<entity name="incident">
<attribute name="title"/>
<attribute name="ticketnumber"/>
<attribute name="createdon"/>
<attribute name="caseorigincode"/>
<attribute name="incidentid"/>
<order descending="false" attribute="title"/>
<filter type="and">
<condition attribute="customerid" uitype="account" value="((paramId)) operator="eq"/>
</filter>
</entity>
</fetch>
Thank you for answering so quickly!
The design on the portal seems to be fine:
-the entities have configured entity permission (permissions on authenticated user)
-the web role also has permissions (authenticated user)
-the users are assigned the authenticated web role
Do you know if I could try modifying the @Query of Lucene ?:
+ (@ Query) _title: (@ Query) _logicalname: knowledgearticle ~ 0.9 ^ 0.3 _logicalname: annotation ~ 0.9 ^ 0.25 _logicalname: adx_webpage ~ 0.9 ^ 0.2 -_logicalname: adx_webfile ~ 0.9 adx_partialurl: (@ Query) _logicalname: adx_blogpost ~ ^ ^ 0.1 -_logicalname: adx_communityforumthread ~ 0.9
Maybe you can modify @Query and filter by customer. The problem is that I don't know how to modify this @Query either
Regards.
Hi partner,
The global search feature is by design in portal.
Best Regards,
Leo
The search that you show is working , it's filtered.
So, the searth that doesn't work is this one(the principal search of Support , on top):
Thank you advanced
Hi partner,
There is an OOB way to do this.
1.Go to Entity List and find the case list.
2.Under the "Filter Conditions" section, select "customer" in "Portal User Attribute".
This means the list will be filter by the customerid = current user id logged in portal.
Let's see the result.
Best Regards,
Leo
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... 290,818 Super User 2024 Season 2
Martin Dráb 229,147 Most Valuable Professional
nmaenpaa 101,156