
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 03:40 AM
Hi everybody,
I have the following email notification script and it want to display the list of cases
var cases = new GlideAggregate('x_rbos2_facilities_job');
cases.addQuery('location.country', gs.getProperty('x_rbos2_facilities.uk.country_id'));//Only UK locations
cases.addEncodedQuery('sys_created_onRELATIVEGT@dayofweek@ago@14');//Last 14 days
cases.addAggregate('COUNT');
cases.groupBy('location');
cases.query();
while (cases.next()) {
template.print(cases.number.getDisplayValue() +": " + cases.location.getDisplayValue() +": " + cases.location.contact.getDisplayValue());
}
However when I test the notification - I get the following. it's only printing the locations
Can anyone advise?
Thanks
Richard
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 03:47 AM
Hello
in the glide aggregate you cant get the access of variables except the grouped by field
try this
var cases = new GlideAggregate('x_rbos2_facilities_job');
cases.addQuery('location.country', gs.getProperty('x_rbos2_facilities.uk.country_id'));//Only UK locations
cases.addEncodedQuery('sys_created_onRELATIVEGT@dayofweek@ago@14');//Last 14 days
cases.addAggregate('COUNT');
cases.groupBy('location');
cases.query();
while (cases.next()) {
var num = new GlideRecord('x_rbos2_facilities_job');
num.addQuery('location',cases.location);
num.query();
if(num.next())
{
template.print(num.number.getDisplayValue() +": " +num.location.getDisplayValue() +": " +num.location.contact.getDisplayValue());
}
}
MARK MY ANSWER CORRECT IT IT HELPS YOU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 03:47 AM
Hello
in the glide aggregate you cant get the access of variables except the grouped by field
try this
var cases = new GlideAggregate('x_rbos2_facilities_job');
cases.addQuery('location.country', gs.getProperty('x_rbos2_facilities.uk.country_id'));//Only UK locations
cases.addEncodedQuery('sys_created_onRELATIVEGT@dayofweek@ago@14');//Last 14 days
cases.addAggregate('COUNT');
cases.groupBy('location');
cases.query();
while (cases.next()) {
var num = new GlideRecord('x_rbos2_facilities_job');
num.addQuery('location',cases.location);
num.query();
if(num.next())
{
template.print(num.number.getDisplayValue() +": " +num.location.getDisplayValue() +": " +num.location.contact.getDisplayValue());
}
}
MARK MY ANSWER CORRECT IT IT HELPS YOU

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-11-2022 03:59 AM
Thank you Mohith!