Is there a way to set some value to scratchpad in the script include and pass the same to business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-07-2016 03:49 AM
Hi,
Is there a way to add some value to scratchpad variable in the script include and pass the same scratchpad to business rule like we have the display business rule to retrieve the database value using g_scratchpad and pass it same in the client script.
Thanks,
Mahesh.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-28-2017 11:13 PM
Hi Mahesh,
The only way I can think of accomplishing this is to create a workflow context when your target record is created, and complete the workflow once all work has been completed with the record. Then what you could do is leverage the scratchpad in the running workflow context to pass data back and forth between Script Includes and Business Rules running against that same record.
Take a look at this: Accessing the Workflow Scratchpad from Business Rules - ServiceNow Wiki
You should be able to use that same approach to access the scratchpad from a Script Include if you have access to current.