"The SOQL query does not appear valid" warning when using `N_MONTHS_AGO`
Issue #2135
resolved
In the SOQL Query tab, this query:
SELECT COUNT()
FROM EmailMessage
WHERE CreatedDate = N_MONTHS_AGO:5
Produces a warning popup, every time you execute the query.
The SOQL query does not appear valid. Would you still like to execute it?
N_MONTHS_AGO
appears without formatting, and with an error marker in front. Clicking “Yes” does run the query successfully.
Changing N_MONTHS_AGO:5
to LAST_N_MONTHS:5
prevents the error. I’m guessing some of the Date Literals aren’t in the symbol table. The full list is available here: https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm
Comments (4)
-
repo owner -
repo owner Fix committed for inclusion in tomorrow's build.
-
repo owner - changed status to resolved
Delivered in 2.2.2.6.
-
repo owner Issue
#2166was marked as a duplicate of this issue. - Log in to comment
Thanks, Jason. Looks like an omission in the Apex/SOQL parser. I'm in the process of getting the Summer '22 release out now but will address this (and any similar omissions) for the release later this week.