class BindWithIncludes {
void example() {
Account A = new Account(Name='xxx');
insert A;
// A bind with INCLUDES clause
Account B = [SELECT Id FROM Account WHERE :A.TYPE INCLUDES ('Customer - Direct; Customer - Channel')]; // <--- Parse error
}
}
This gives the following parse error:
Syntax error at 7:50: mismatched input ':' expecting {'for', 'update', 'with', 'using', 'where', 'order', 'limit', 'group', 'all', 'offset', ']', ','}
Syntax error at 7:67: missing ';' at '('
Syntax error at 7:108: extraneous input ']' expecting ';'
2.
class BindWithDivision {
public void soslQuery() {
// A SOSL query with binds in all possible clauses
String myString1 = 'aaa';
String myString2 = 'bbb';
Integer myInt3 = 11;
String myString4 = 'ccc';
Integer myInt5 = 22;
List<List<SObject>> searchList = [FIND :myString1 IN ALL FIELDS
RETURNING
Account (Id, Name WHERE Name LIKE :myString2
LIMIT :myInt3),
Contact,
Opportunity,
Lead
WITH DIVISION =:myString4 // <--- parse error
LIMIT :myInt5];
}
}
While testing the examples from https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_SOQL_variables.htm I found two cases, which are not yet supported by apex-parser:
1.
This gives the following parse error:
2.
This gives the following parse error: