Delegates in Custom Application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2023 03:35 PM
We have a custom app that requires approval of a document where we need Delegate functionality. There is a delegate feature in the global scope and if used as is will allow all delegation for all tasks/assignments/approvals. We want to limit it to only approvals coming from the custom app.
Appreciate any ideas/suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2023 06:33 PM
In order to limit the delegate functionality to approvals coming from your custom app, you can create a custom Delegation process specific to your custom app. Here are the steps to do that:
- Create a new Script Include in ServiceNow, and name it something like "CustomAppDelegation".
- In the Script Include, define a function that handles the delegation process for approvals in your custom app. The function should take in the necessary parameters like the approval record, the delegate user, and the delegate role.
- In the custom app, create a UI action that calls the function defined in the Script Include when the "Delegate" button is clicked.
- In the UI action, pass in the necessary parameters like the current approval record and the user and role being delegated to.
- Make sure to test the custom delegation process thoroughly in a development instance before deploying it to production.
By following these steps, you will be able to create a custom delegation process that is specific to your custom app, and will not affect the global delegation process. It will give you the control over how the delegation process works in your custom app, and will limit it only to approvals coming from the custom app.
It's also possible to use the OOB Delegation functionality, but add some script to check that the record being delegated is coming from the custom app, by checking the sys_class_name or any other fields that can uniquely identify the custom app records.
Please note that this process may vary depending on the version of ServiceNow that you are using. It's always recommended to test these changes in a development environment before applying them to production. Also, be careful when modifying or disabling any of the OOB functionality as it may affect the overall functionality of the instance.