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

By screenshot I meant the screenshot of the field the tables involved the the expected result

Schema map would that be helpful ?