Closed MirzaHamza00 closed 10 months ago
Thanks for reporting (again) - I didn't have many test-cases for NOT
so these slipped and they are not used by many people so they were undiscovered (kudos!)
I'll try to take a look in the next couple of days and see if I can get it resolved.
SELECT Id, City FROM Lead WHERE NOT ((NOT (City LIKE '%LHR%')) AND City LIKE '%KHR%')
is parsed to the following and is successfully composed back to the same initial query.
{
"fields": [
{
"type": "Field",
"field": "Id"
},
{
"type": "Field",
"field": "City"
}
],
"sObject": "Lead",
"where": {
"left": null,
"operator": "NOT",
"right": {
"left": {
"openParen": 2
},
"operator": "NOT",
"right": {
"left": {
"field": "City",
"operator": "LIKE",
"literalType": "STRING",
"value": "'%LHR%'",
"openParen": 1,
"closeParen": 2
},
"operator": "AND",
"right": {
"left": {
"field": "City",
"operator": "LIKE",
"literalType": "STRING",
"value": "'%KHR%'",
"closeParen": 1
}
}
}
}
}
}
Hi @paustint, The issue mentioned in the summary is functioning properly but there is another scenario related to that. When I add a second condition with any operator with the first condition having the NOT LIKE operator and wrapping the whole query in NOT, the JSON produced by the parser is corrupted.
Here is the Reference Query:
Select Id, City from Lead where NOT ((NOT (City LIKE '%LHR%')) AND City LIKE '%KHR%')
I tested this query on the Developer Console and it's working fine there but the generated JSON is missing the first City condition. Example 1:
Example 2: