1 Reply Latest reply on Oct 25, 2017 12:03 AM by iamsaanvi

    Error MessageSystem.QueryException: unexpected token: '('

    iamsaanvi

      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

       

       

      01global class batchAccountUpdate implements Database.Batchable<sObject> {

       

       

      02    global Database.QueryLocator start(Database.BatchableContext BC) {

       

       

      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';

       

       

      04       

       

       

      05        return Database.getQueryLocator(query);

       

       

      06    }

       

       

      07  

       

       

      08    global void execute(Database.BatchableContext BC, List<Opportunity> scope) {

       

       

      09         for(Opportunity Opp : scope)

       

       

      10         {

       

       

      11             Opp.Has_ABC_Product__c = True;           

       

       

      12         }

       

       

      13         update scope;

       

       

      14    }  

       

       

      15   

       

       

      16    global void finish(Database.BatchableContext BC) {

       

       

      17    }

       

       

      18

      }

       

      Thank in Advance