andrew_och
ServiceNow Employee
Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
8m ago
The problem
With the SLA Engine set to asynchronous processing mode, task_sla records are created after the task is inserted/saved. So a user who opens a new incident and saves it or even updates will not see corresponding Task SLA records in the related list, even though SLAs are being attached in the background. As we know the related lists only update after a manual page refresh/reload.
The Fix
Using three pieces that work together:
- A business rule (
SLA Engine Async scratchpad) runs before the form displays and copies thecom.snc.sla.engine.asyncproperty into the scratchpad. The client can then tell whether async mode is on without a server round trip. - A client script (
TaskSLA Related List Refresh) runs onLoad. If async mode is on, it subscribes to an AMB channel for the current task's task_sla records. - A Record Watcher on
task_slapublishes a message to that channel whenever the SLA Engine inserts or updates a task_sla record for the task. When the message arrives, the client script refreshes the Task SLA related list.
The majority of the work is done by the client script that you can see below.
Both client script and business rule are attached to this article.
Labels:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.