Does addEncodedQuery work with addQuery

yundlu316
Kilo Guru

I have a GlideRecord query that looks something like this:

var ka = new GlideRecord('x_81991_knowledge');

  ka.addQuery('workflow_state', 'Published');

  ka.addQuery('kb_category.label', 'Benefits');

  var qry = "seriesLIKE"+occ+"^NQlocationLIKE"+loc+"^NQseriesISEMPTY^locationISEMPTY";

  ka.addEncodedQuery(qry);

I've noticed that the Encoded query and the regular addQuery dont' seem to work together.   For instance in the above query, I would expect the list of knowledge articles to be filtered to only Published articles, and with category Benefits, and then by series/location in the encoded query.   However, it seems like the encoded query doesn't take into account the other addquery.   This still returns article regardless of category...

Any suggestions?

1 ACCEPTED SOLUTION

Thanks Patrick and sherrysullivan, I actually got the query to work by simply moving the addEncodedQuery line above all of my addQuery lines.   I'm not sure why the order matters, but that solved the issue.   If you have any insights as to why this worked, I would love to learn about it.   Thanks!


View solution in original post

5 REPLIES 5

G24
Kilo Sage