Please could someone help me
Error MessageSystem.QueryException: unexpected token: '('
Stack TraceClass.batchAccountUpdate.start: line 4, column 1
I get this error message when I am trying to run the test class for this batch
01 global class batchAccountUpdate implements Database.Batchable
Error MessageSystem.QueryException: unexpected token: '('
Answers
I think you may find better answers from a Developer community than this one, which is for finance and accounting people - i.e. end users of technology.
While not an expert and Len's answer is 100% correct try this:
You wrote:
03 String query = 'SELECT id, Name FROM Opportunity WHERE Createddate =:system.today() AND Status <> \'closed\' AND Has_IBM_Product__c = False AND Id IN : (SELECT OpportunityId FROM OpportunityLineItem WHERE pricebookentry.product2.family =\'XYZ\') limit 10';
I'd try:
03 String query = 'SELECT id, Name FROM Opportunity WHERE Createddate =:system.today() AND Status <> 'closed' AND Has_IBM_Product__c = False AND Id IN : SELECT OpportunityId FROM OpportunityLineItem WHERE pricebookentry.product2.family ='XYZ' limit 10';
Not sure about the ":" after ...id IN, but you get the idea.