"Dot-Walk" A Document ID Field?

stevejarman
Giga Guru

I'm trying to execute the following query:

var rs = new GlideAggregate("metric_instance");
rs.addTrend("start", "Date");
rs.setGroup(false);
rs.addAggregate("SUM", "duration");
rs.addAggregate("MIN", "id.priority");
rs.addEncodedQuery(
  "definition=35edf981c0a808ae009895af7c843ace^sys_created_onONLast week@javascript:gs.beginningOfLastWeek()@javascript:gs.endOfLastWeek()"
);
rs.orderBy("start");
rs.query();

But getting an error:

JoinQuery invalid field name: id.priority
DBQuery logic error.  Could not find join for field id.priority: no thrown error

Is it not possible to dot-walk Document ID fields? Or not possible within an addAggregate? Or just not possible 🙂

1 REPLY 1

Jace Benson
Mega Sage

Document ID Fields cannot be dot-walked.

If you need this data, you could make a database view between this table, and the table the document id field is linked to for this record.  If it's generally a task table point to the base table.  Then GlideAggregate off of the database view.