How to call a function using try and catch block in script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 12:57 AM - edited 09-28-2023 01:01 AM
Hi Team,
I'm getting the status code value from a "try" block as below and trying to call a function sendEmail().
It fails if called using "this".
How to call the function to trigger the email notification?
The same works if the code is added directly on the "If" condition.
Sujatha V.M.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 01:21 AM
Hi @Sujatha V M
I tried this code in my PDI, it is working fine.
Did you find any error log in system logs? And try adding gs.info(ex.message); in your catch block to see if there is any error caught.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-28-2023 05:56 AM
Thanks for the response. I'm getting the status error code using this "status = response.getStatusCode();"
Why is that I'm unable to call the function using this?
What is the other way to call the function sendEmail() within the try block?
Sujatha V.M.