if count
is greater than 0, you need to call gr.next()
to load each record in the collection, otherwise, the gr
instance you are passing to gs.eventQueue(...)
is going to be unpopulated with results (eventQueue only handles a single, populated GlideRecord).
If you're potentially expecting a collection of records, you'll need to iterate them like so:
gr.query();
while (gr.next()){
gs.eventQueue("change_task.duedate_reminder", gr, gs.getUserID(), gs.userName());
}