addOrCondition() not working with addQuery() function !!

shivcharan
Kilo Explorer

Hello,

I need to write a multiple AND query along with OR conditions for addQuery() function.

When I try to write the following piece of code :-

var gr = new GlideRecord('sys_update_xml');

gr.addQuery('sys_updated_by',a).addOrCondition('sys_updated_by',c).addOrCondition('sys_updated_by',d);

gr.addQuery('target_name',aa).addOrCondition('target_name',ab);

gr.query();


I am writing it as a CLIENT SCRIPT. I also tried it by running it in the WORKFLOW but nothing worked.

Kindly help.

5 REPLIES 5

MALLIKARJUNY
Tera Contributor

Var grInc = new GlideRecord('incident');

grInc.addQuery('category', 'software').addOrCondition('state' , 'new');

grInc.query();

While(grInc.next())

{

gs. print(grInc.number);

}

gs. Print(grInc. getRowCount());