Update field in list view when incident table loads
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 04:03 PM
Hello,
I have a requirement to get the 'business elapsed percentage' field from the current SLA of an incident record on the incident list view, so the customer can quickly prioritize incidents.
I was successful in doing this (above screenshot), however, the field only updates in the list view when you click into the record and navigate back to the incident table. How can I get the field to update every time you navigate to the incident table or refresh your browser, so you do not have to click into the record in order to update that field on the list view?
I have also attached the business rule (on Task SLA table) I used to accomplish this for reference (below). If there is any modifications I need to make to the business rule please let me know. It is currently set to run AFTER insert and update.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 05:18 PM
The SLAs for a task (so for an Incident too) are recalculated by a display Business Rule (called Calc SLAs on Display). That is why users need to open the form for it to happen.
So I suppose what you could do is to Create a UI Action for the list that users can press to update the SLAs of the Incidents in the list. However do make sure to build in checks and safeguards against abuse of that refresh functionality, to prevent slowing down or even bringing down the instance. What exactly you need to call for the recalculation to be executed, you can look for it in the Business Rule I mentioned above.
A couple of notes about the BR:
- in it check that get() return true and only if it does, do execute the subsequent statements - actually always do that check.
- I'm not sure if in case just one record is updated it still applies, but normally inc.updateMultiple() needs the value to be set using inc.setValue(). The way it is written and given that only one record is updated anyway, it is better to use just inc.update().
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2022 08:10 AM
Hi Janos,
thanks for your reply. What I am trying to do is have it update automatically, so I am also trying to create a fix script and then create a scheduled job that would call that fix script. I am able to call the fix script from the scheduled job, but having trouble getting the fix script to run. Below is the code for the fix script. The code next to the blue line is the exact code from the "calc SLA's on display' business rule. I am not getting an error when I run it, however, none of the current task sla's for incidents are updating. Anything I am missing here?:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2022 12:06 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2022 10:01 AM