We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

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());