Reference field from a table gives Undefined value

Lyubomir1
Tera Contributor

Hello Everyone,

I'm trying to query a table with a reference field with the following conditions:

var sysID = current.sys_id.toString();

var reqTask = new GlideRecord('u_request_tasks_definition');

reqTask.addQuery('u_order', '>', workflow.scratchpad.currentOrder);

reqTask.addQuery('u_associated_item.sys_id.toString()', sysID);

u_associated_item is the name of a column that is a reference to the sc_cat_item table. However when i try to make the condition the value returned from it is undefined. I also tried reqTask.u_associated_item, reqTask.u_associated_item.sys_id, reqTask.u_associated_item.toString() and so on but the value in the gs.log is every time Undefined. Any help will be greatly appreciated. Thanks!