- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi Community Members,
I’m working with a Data Resource of type Transform, where mutating is set to true (so it doesn’t return a value). I have a use case where I need to run a script via this Data Resource to validate certain fields and update records accordingly.
Here’s the scenario:
- If all required fields are filled in, the record should be updated.
- If any required field is missing, I want to terminate the Data Resource execution and trigger a failure event, which I can then use to display an appropriate error message.
Is there a recommended way to gracefully terminate the Data Resource in such cases and map it to a failure event?
Thanks in advance!
Regards,
Sanjay Kumar
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Shashank,
The above didn't work.
But we found a solution.
//This would terminate the script broker execution and we can configure the failure event for the data resource
Thanks,
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
1. Use actionResponse.setError("message") → it stops execution and shows the error in Test Load
(Inside the Server Script function signature)
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi Shashank,
The above didn't work.
But we found a solution.
//This would terminate the script broker execution and we can configure the failure event for the data resource
Thanks,
Sanjay