Direct editing cells in Project Workspace not triggering custom Business Rule

DavidB-ADT
Tera Guru

Working on a user-requested enhancement to automatically update a project task's percent complete if state is Work in Progress and status is Green.

 

The Business Rule and associated Script Include are working for the most part, but not if you directly edit the status cell in the PW Planning screen.

 

Here's an example of it working. If you click on a task to edit it and change the state, the business rule kicks in and updates the Planning screen. On the task record, you'll see the green markers showing fields that have been updated.

(Sorry for speedy actions in the GIF, trying to keep it under the upload size limit)

screen-capture (4).gif

 

However, this doesn't work if you directly edit the cell in the Planning screen in PW. Notice how the record doesn't get real-time updates, and has to be reloaded to reflect the change in state.

screen-capture (5).gif

 

My Business Rule works on the task editing mode when scoped for either the Project Task table, or the Planned Item table (task type = Project Task), and I've tested it with 'Before' and 'After' Update configurations. My only theory so far is that PW is making record updates via API calls and maybe bypassing BR triggers. Does anyone have any ideas?

4 REPLIES 4

DavidB-ADT
Tera Guru

Think I might have answered my own question. Digging into UI Builder, I can see a 'Save Data Handler' client script that calls the project_workspace/saveData API:

DavidBADT_0-1747683984011.png

Digging into that Scripted REST API, it's using some PlannedTaskBatchApi to make changes to records. Can't see any further under the hood, but guessing it's not triggering BRs with the update. Going to park this as a UI limitation.

 

Work around I have is a scheduled job to update percent_complete each day if the task is green and work in progress, so the update will happen if they do in-line editing, just not in real-time. I'll coach users to do it by directly editing the task instead.

Govardhan7
ServiceNow Employee
ServiceNow Employee

Hi @DavidB-ADT ,

Out of the box, Business Rules are disabled for edits on the Planning page of the Project Workspace to optimize performance. If needed, customers can enable them by setting the sn_pw.save_data_with_glide_record property to true.

Hi there,

Even when this property is set, business rule messages are not appearing on the planning console. Is there a limitation with showing info messages on the planning console ui?
Thanks!

Govardhan7
ServiceNow Employee
ServiceNow Employee

At present, Business rule messages are not shown. This enhancement is planned for a future release cycle.