Manually trigger a Playbook
-
- UpdatedAug 3, 2023
- 3 minutes to read
- Vancouver
- Navigation and UI
The Vancouver release is no longer supported. As such, the product documentation and release notes are provided for informational purposes only, and will not be updated.
Use a server script to manually trigger a playbook.
Trigger Playbook function
Manually trigger a Playbook using a server script function with the following
code:
Replace
<scoped name>
with the scoped name of your playbook. You can find the
scoped name by locating the process definition in the
sys_pd_process_definition table and copying the name and
application scope fields. Replace parentRecord
with the input/parent record
you want to run the process on.The server script throws an exception on failure. You can add an info message when successful and an error message on failure.
Helper functions
Use the following scriptable function to determine if a Playbook is already running on a
record before displaying a UI action or declarative action to trigger
it.
To view every playbook running on a given parent record use the following
code:
This
information can be used to control when to show a trigger playbook action such as a UI
action.The following section is an example of how to use the trigger playbook function to create an Add Playbook button.
Create an Add Playbook UI Action
Create an Add Playbook UI Action in workspace.
Before you begin
Role required: workspace_admin
Procedure