From 4848474a90cbfe4dd4c69899b578272a6ccfd3eb Mon Sep 17 00:00:00 2001 From: AmrutaKR007 Date: Mon, 20 Oct 2025 15:06:16 +0200 Subject: [PATCH] Update approval.js Instead of hardcoding the table name . Write current.sys_class_name so that in future if we we need the business rule on change tasks. We can write the business rule on Task table. --- .../approval.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Server-Side Components/Business Rules/After-BR to generate approvals for catalog tasks/approval.js b/Server-Side Components/Business Rules/After-BR to generate approvals for catalog tasks/approval.js index b817a01d84..c68f524518 100644 --- a/Server-Side Components/Business Rules/After-BR to generate approvals for catalog tasks/approval.js +++ b/Server-Side Components/Business Rules/After-BR to generate approvals for catalog tasks/approval.js @@ -6,7 +6,7 @@ var sysApp = new GlideRecord('sysapproval_approver'); sysApp.state = 'requested'; //set the state to requested sysApp.sysapproval = current.sys_id; // set the 'Approval for' field with the current catalog task - sysApp.source_table = 'sc_task'; // set the source table field so that document ID table can be updated properly as it is dependent on source table field. + sysApp.source_table = current.sys_class_name; // set the source table field so that document ID table can be updated properly as it is dependent on source table field. sysApp.approver = 'sys_id of the person for whom you want to trigger this approval'; // set the approver sysApp.document_id = current.sys_id; //set the sys_id to populate correct value in the Approving field.