- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 01:03 AM
Hi,
I created an email script to populate the email body of a notification. The notification is in the Catalog task [sc_task] table and it will require data from the Requested item [sc_req_item] table for its content. For some reason, dot-walking the fields using the request_item reference field on the Catalog task table doesn't seem to work (must be a known issue based on this KB article - Email scripts doesn't populate the dot walking field values in outbound emails - Support and Trouble...) .
With this, I have decided to use a script include instead and return an object containing all the fields needed for my notification. Please see my scripts below:
Email script:
Script Include:
I checked my script include with a background-script using a static sys_id and it works just fine. But when I call this script include method from my email script, it doesn't work. It will execute the "else" statement even though the sys_id passed is correct (I logged the ritmID to check its value and it is the correct sys_id).
I am not sure what other actions I can do after this. Please advise.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 01:59 AM
As per thorough investigation, there is a query business rule on the Requested item table and the 'system' user does not meet the condition to query the Requested item table. To fix this, I only added a gs.interactive condition in the BR script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-02-2024 02:04 AM
Hi @MarkWendilJhonD ,
Why are you using script include instead you can populate the email body from the email script itself.
Your script include is not working because you are passing current.request_item which is an object.
Take out the Glide part in script include and try to access required values from RITM object parameter.
If my solution works kindly mark it as correct answer and don't forget to click thumbs up button.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2024 01:59 AM
As per thorough investigation, there is a query business rule on the Requested item table and the 'system' user does not meet the condition to query the Requested item table. To fix this, I only added a gs.interactive condition in the BR script.