码家

Web Platform, Cloud and Mobile Application Development

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

Aggregate query has too many rows for direct assignment, use FOR loop

 

 

错误的代码:

 if (query == '' || query == null){
   query = 'SELECT id, name, ownerid, Planned_Visits__c,  Actual_Visits__c, Visits_last_Year__c, ' +
     '  (SELECT AccountId, id, Type, ActivityDate, Visit_Report__c ' +
     '   FROM events WHERE AccountId != null and Type != null and ActivityDate != null and Type = \'Sales Visit\' and Visit_Report__c = TRUE AND  ) ' +
     'FROM Account where owner.IsActive = true ' +
     //'     AND id IN(\'001P000000ZKblDIAT\', \'001P000000ZKboRIAT\', \'001P000000ZKd55IAD\', \'001P000000ZKd5KIAT\', \'001P000000ZKd5UIAT\')' +
     '';
  }

posted on 2012-11-01 18:21  海山  阅读(430)  评论(0编辑  收藏  举报