- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2021 11:51 PM
If I comment this method(setWorkflow), then my other methods output gets wrong.....
var ga = new GlideAggregate('u_empdata');
ga.addAggregate('SUM', 'u_salary');
ga.addAggregate('COUNT','u_salary');
ga.addAggregate('AVG', 'u_salary');
ga.addAggregate('MIN', 'u_salary');
ga.addAggregate('MAX', 'u_salary');
//ga.setGroup(false);
ga.query();
if (ga.next()) {
gs.log('Total: ' + ga.getAggregate('SUM', 'u_salary'));
gs.log('Num: ' + ga.getAggregate('COUNT', null));
gs.log('Average: ' + ga.getAggregate('AVG', 'u_salary'));
gs.log('Min: ' + ga.getAggregate('MIN', 'u_salary'));
gs.log('Max: ' + ga.getAggregate('MAX', 'u_salary') + '\n');
}
Solved! Go to Solution.
- Labels:
-
flow designer
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 09:15 PM
hi,
the reason to setWorkflow(false) is
1. when working on incident or any other custom table, there are chances that in background lot of Workflows might be executing.
so, If particular workflow is active at this time, it may manipulate our answer. this hampers our solution.
hope, this solves your doubt..
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2021 03:04 AM
This is to tell the Ajax that the results should be grouped.
You can see the documentation for this method here: https://developer.servicenow.com/dev.do#!/reference/api/orlando/server/no-namespace/c_GlideAggregate...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2021 09:15 PM
hi,
the reason to setWorkflow(false) is
1. when working on incident or any other custom table, there are chances that in background lot of Workflows might be executing.
so, If particular workflow is active at this time, it may manipulate our answer. this hampers our solution.
hope, this solves your doubt..
Thank you