workflow to script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2024 11:42 AM
Hello developers, i need to p send workflow scratchpad variables to script include without function call. is this possible that i can use workflow variables in script include. ANy help is appreciated, Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2024 11:46 AM
Hello,
Yes, it's possible to access workflow scratchpad variables in a Script Include, but typically not directly without some interaction. Workflow scratchpad variables are stored in the current workflow context, so if you're working within the same session or context, you can pass the variables indirectly to your Script Include. Here's a general approach:
Use workflow.scratchpad: If you're within the same workflow or calling the Script Include from a Workflow Activity, you can pass the workflow.scratchpad values as parameters to your Script Include.
Access from current context: If you're using a Business Rule or a Script Include triggered by the workflow, you can access the variables from the current object and then pass them to your Script Include.
Global scratchpad object: You can also use a global variable to store scratchpad values, which can then be accessed by the Script Include. Though this method isn't recommended due to potential security and maintenance issues, it's a workaround.
Without making a direct function call, you'll need to make sure there's a way to pass or reference the scratchpad values, usually during the transition from workflow to other parts of the system.
Hope this helps! Let me know if you need more specifics.
Best regards,
Raja

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2024 11:52 AM
No. You can't pass the variables to a script include without passing the variables in the functions.
Could you please elaborate, what is your use case?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2024 01:10 PM
Hello @sanjivmehr : based on approved/rejected i need to pass workflow scratchpad values to s.i, when rejected these will be empty so in function call empty parameter will be sent so is there any workaround. Thanks!