addActiveQuery() and addEncodedQuery()

nataliya_b
Tera Guru

Hello All

I am running script include function and just notice that

this code lines sequence does not filter for active records

var gr = new GlideRecord(someTable);

gr.addActiveQuery();

gr.addEncodedQuery(strQuery); //

gr.query();

but this one does

var gr = new GlideRecord(someTable);

gr.addEncodedQuery(strQuery);

gr.addActiveQuery();

gr.query();

 

I could not find any docs regarding this 

Does anyone have the same experience? Where could I read about it?

thank you

1 ACCEPTED SOLUTION

Does the encoded query contain an or condition? Or (multiple) layered and conditions?

Then it would matter if the active=true is at the beginning. Or at the end and then part of an or condition for example.

View solution in original post

13 REPLIES 13

Thank you

Willem
Giga Sage
Giga Sage

Does your table have an 'active' field/flag? If not, the addActiveQuery does not work.

You have to add your own query to determine when the record is active.

yes, it does. I am quering  pc_vendor_cat_item table.

sorry cannot share strQuery on internet

Does the encoded query contain an or condition? Or (multiple) layered and conditions?

Then it would matter if the active=true is at the beginning. Or at the end and then part of an or condition for example.