Email script returns undefined when i enabled application admin in scoped application
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 04:45 AM
Hi Everyone ,
I have a custom application and there is an email notification on approver table which gets the non task table field values into the notification . It always returns undefined.
This is the sample code.
Pleas help.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 08:59 AM
var leaveRequest = new GlideRecord('leave_request');
if(leaveRequest.get(current.document_id)) {
gs.info("*****Test the Info");
var duration = leaveRequest.getValue('duration');
gs.info("*************************Test Info Inside*** " +leaveRequest.getValue('duration'));
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2023 09:12 AM - edited 12-19-2023 09:14 AM
Hi @Swathi P ,
There is an extra space in line 2 in your script, test your code by removing it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 10:20 PM
Its not working. Its not getting inside If loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2023 12:57 AM