NQ operator not returning results in EncodedQuery

Anubhav24
Mega Sage
Mega Sage

Hi All,

I have a below table structure Parent table and m2m table for customers having reference to parent table.

Parent table : u_serte

Relationship Table : u_m2m_companies_sertu

 

Now I have all records on Parent table and there are few records which have one to many relationships with m2m table, ex of relationship is one to many where records on parent table can have multiple customers mapped to them.

If a customer is there then we have a field customer restricted which is set to true and if no customer then this is set to false.

Now when I go to raise a request and select a customer , so now the result should show all the records from parent table where customer is there and all the records where there is no customer.

I have written below query:

"u_tem=SR Day^u_active=true^JOINu_serte.sys_id=u_m2m_companies_sertu.u_serte!u_company=" + comp + "^NQ" + "u_active=true^u_tem_type=SR Day^u_customer_restricted=false" + "^EQ";

 

No matter what order I try , records returned are always those records where there is a relationship established with customer. Both encoded queries work fine when executed individually but the moment I add OR condition non customer records are never returned.

6 REPLIES 6

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

Can you use the below code in the encoded query:-

 

"u_tem=SR Day^u_active=true^JOINu_serte.sys_id=u_m2m_companies_sertu.u_serte!u_company=" + comp + "^NQu_active=true^u_tem_type=SR Day^u_customer_restricted=false";

 

Please mark my answer as correct based on Impact.

Tried this version of query with just u_active=true , it returns 10 extra records only where as it should return atleast 1000 records

Can you paste some screenshot it would be easier to assist.

 

Thanks.

By screenshot you mean screenshot of the result returned from above query or query's screenshot.

Also I tried just concatenating by adding queries in 2 variables and then executing them then also it didn't worked out.