System.QueryException : Unexpected token ‘(‘ or Unexpected token ‘{‘

I had a problem with doing a Batch Update of OwnersId using Apex Batch. You can do the following: Set<String> accNames = new Set<String>(); accNames = ReassignIncorpsAfter60Days.returnAccountIdForContactWithTaskOlder60Days(); System.debug(Database.query(‘Select id, (Select id from Account.Contacts), (Select id from Account.Opportunities) from Account where Id IN :accNames’)); Note: Make sure the variable or method is available (public) in the […]

Rate this:

Read More