get a field value in the glideAggregate

Must include a groupby clause in order for the getValue (or getDisplayValue() on a reference field) to work


var REQsysid='3eac6cbddb75a81081fb49a23996xxxx'; var agg = new GlideAggregate('sc_req_item'); agg.addQuery('request', REQsysid); agg.addAggregate("COUNT"); agg.groupBy('short_description'); agg.query(); var answer = 0; while(agg.next()) { gs.print( agg.getAggregate("COUNT")); gs.print('SD:'+agg.short_description.getValue()); }

Comments

Popular posts from this blog

GlideRecord setValue

variable advanced reference qualifier example

Running transform maps asynchronously