Set up approvals for planned records
Register the approval consumer so YouDesign Command can ask for approval before a planned record becomes real.
In YouDesign Command, a planner can turn a planned record into a real one. A Command administrator can require approval for that, per record type. Approval needs one record on the instance first: the approval consumer that ties these requests to the code that applies them. Do this once per instance, after installing or upgrading to a release that includes it.
Without it, every record type set to Approval falls back to the planner's own create rights, and Global Settings > General says Approvals for this are not set up on this instance.
Before you start
The release that adds Make current is installed. It includes the Script Includes
FSRMaterializeApprovalExecutorandFSRMaterializeRequest.
Steps
In ServiceNow, open Scripts - Background (filter navigator:
Scripts - Background).In in scope, choose YouDesign Command (
x_inpgh_upmx).Paste this script and click Run script:
new x_inpgh_upmx.YCMApproval().registerConsumer( 'fsr_materialize', 'Make a Future State plan current', 'FSRMaterializeApprovalExecutor', JSON.stringify([{ key: 'future_of_class', label: 'Class, as listed in the setting', type: 'string' }]) );
Running it again is safe: it updates the existing record and leaves it active.
Check it worked
Open the table
x_inpgh_upmx_approval_consumer.listand find the row with Tokenfsr_materialize. It is Active, and its Callback isFSRMaterializeApprovalExecutor.In the portal, open Global Settings > Approvals and click Add Policy. Make a Future State plan current is offered as a Consumer.
Reference
Approval consumer
fsr_materialize in x_inpgh_upmx_approval_consumer
Ties approval requests for planned records to the code that applies them
Approval executor
FSRMaterializeApprovalExecutor
Makes the plan real when its request is approved, and describes the request to approvers
Setting
fsr.materialize_entitlement in x_inpgh_upmx_global_settings
Per record type: create_rights or approval, with * as the default. Edited in Global Settings > General
Scope attribute
future_of_class
The record type a request is scoped by: the one listed in the setting that decided, so a policy for a type also covers its more specific types
Related
Last updated