Recent Documents view is showing all viewed documents

book

Article ID: 36439

calendar_today

Updated On:

Products

SUPPORT AUTOMATION- SERVER CA Service Desk Manager - Unified Self Service KNOWLEDGE TOOLS CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Problem

When looking at "My Recent Documents" view within the CA Service Desk Manager (CA SDM) Knowledge Tab, all previously viewed documents are shown and not just the ones viewed 'recently'. This will cause "My Recent Documents" to show a lot of results.

Cause

This is a result of the out of the box page loading without any filter. Notice in the screenshot below how the earliest hit date has no filter:

<Please see attached file for image>

Before.png

Environment

CA Service Desk 12.x and 14.1

Windows, Unix and Linux

Workaround

1.  Open Web Screen Painter

2. Open the form 'kt_faq_tree.htmpl'

3.  Click on the source tab and search for the following code

-----------------------Code begin-------------------------
//"My Recent Documents" node selection
else if (lCurrCatID == -4)
{
var contentUrl = cfgCgi+"?SID="+cfgSID+
"+FID="+cfgFID+"+OP=SEARCH+FACTORY=BU_TRANS+QBE.EQ.USER_ID=$cst.id+KEEP.opener=my_recent_docs";
ahdframe.location.replace(contentUrl);
ahdframe.parent.setPreviousSearchUrl(contentUrl);
}
------------------------Code End--------------------------- 
 

4.  Replace it with

-----------------------Code Begin-------------------------

//"My Recent Documents" node selection
else if (lCurrCatID == -4)
{
var NUM_HIT_DAYS = 7;
var earliestHitDate = new Date();
earliestHitDate.setDate(earliestHitDate.getDate() - NUM_HIT_DAYS);

var contentUrl = cfgCgi+"?SID="+cfgSID+
"+FID="+cfgFID+"+OP=SEARCH+FACTORY=BU_TRANS+QBE.EQ.USER_ID=$cst.id+KEEP.opener=my_recent_docs+QBE.GE.BU_DATE="+nx_escape(date_to_string(earliestHitDate.getTime()/1000,false));
ahdframe.location.replace(contentUrl);
ahdframe.parent.setPreviousSearchUrl(contentUrl);
}

-----------------------------------Code End--------------------

Here the NUM_HIT_DAYS is set to 7 which means the earliest hit date is not older than 7 days.

5.  Save and Publish the form change

6.  Notice now that there is an earliest hit date filter based on the NUM_HIT_DAYS value set:

<Please see attached file for image>

after.png

 

Environment

Release: SDMU0M99000-14.1-Service Desk Manager-Full License
Component:

Attachments

1558723419512000036439_sktwi1f5rjvs16wuo.png get_app
1558723417296000036439_sktwi1f5rjvs16wun.png get_app