• AKM123
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
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
 
global class batchAccountUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        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';
        
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Opportunity> scope) {
         for(Opportunity Opp : scope)
         {
             Opp.Has_ABC_Product__c = True;            
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}

 
  • October 04, 2017
  • Like
  • 0
Hi
I am trying to make a http call to onedrive, I am getting error stating that I have not put grant_type parameter in the setBody although I put it

This is how I written
req.setBody('{"grant_type"="'+AuthToken+'","client_id"="'+client_id+'","redirect_uri"="'+redirect_uri+'","client_secret"="'+client_secret+'","refresh_token"="'+refresh_token+'","resource"="'+resource_id+'"}');

This is the requirement
POST https://login.microsoftonline.com/common/oauth2/token
Content-Type: application/x-www-form-urlencoded

BODY:
client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret} &refresh_token={refresh_token}&grant_type=refresh_token&resource={resource_id}

Thanks in advance
  • March 10, 2016
  • Like
  • 0
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
 
global class batchAccountUpdate implements Database.Batchable<sObject> {
    global Database.QueryLocator start(Database.BatchableContext BC) {
        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';
        
        return Database.getQueryLocator(query);
    }
   
    global void execute(Database.BatchableContext BC, List<Opportunity> scope) {
         for(Opportunity Opp : scope)
         {
             Opp.Has_ABC_Product__c = True;            
         }
         update scope;
    }   
    
    global void finish(Database.BatchableContext BC) {
    }
}

 
  • October 04, 2017
  • Like
  • 0