Service Portal show closed incidents and request items

steveturley2
Giga Expert

Hi all

We've got a requirement for the ServicePortal to show users closed as well as their open incidents & requests.

The list of these comes from a Header Menu scripted list called 'My Calls'

Looking at the code, is it as simple as removing the highlighted text, or something a bit cleverer?

find_real_file.png

1 ACCEPTED SOLUTION

Dont remove

t.record_watchers.push({'table':'incident','filter':'active=true^caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'active=true^requested_for=' + u});

replace them with 

t.record_watchers.push({'table':'incident','filter':'caller_id=' + u});
t.record_watchers.push({'table':'sc_request','filter':'requested_for=' + u});

and in places where you have used addActiveQuery(), add an "//" before them 

View solution in original post

16 REPLIES 16

VigneshMC
Mega Sage

record watchers are used to look for any new change after the page is loaded (to respond to table updates in real-time). You have to update this and as well as, other script which populates these data initially .

Thanks

steveturley2
Giga Expert

I'm honestly not sure what you mean. It's the list of records that are displayed as a default. Nothing to do with changes in the page after it is loaded.

Can you post the complete code?

 

What the record watchers do is described in the comment above "t.record_watchers = []". 
Your highlighted code will help the Header menu item keep the correct count that shows how many records meet that criteria.
find_real_file.png
It watches the records meeting the criteria for any changes and updates the t.items list to keep the count in synch. 


The list is made from what is pushed in t.items and that is from the script that is below your highlighted area.
find_real_file.png

 

Or at least that how it works OOB. But it does look like below the code is changed and parts are commented out. So, it depends on what the rest of the code is doing.