J'utilise un SOQL comme ci-dessousrequête globale ne prend pas en charge queryMore(), utilisez LIMIT pour restreindre les résultats à un seul lot Erreur
select COUNT(Transaction_Type_Id__c) tt, Id__c from Analysis_set_header__c group by Id__c
L'objet ayant au total 42 records.but Je reçois comme erreur
La requête agrégée ne prend pas en charge queryMore(), utilisez LIMIT pour restreindre les résultats à un seul lot.
Voici ma classe de lot
global class AnalysisSetWsCodeBatchClass implements Database.Batchable<sObject>, Database.AllowsCallouts {
public String query = 'select COUNT(Transaction_Type_Id__c) tt, Id__c from Analysis_set_header__c group by Id__c';
global Database.QueryLocator start(Database.BatchableContext BC) {
return Database.getQueryLocator(query);
}
global void execute(Database.BatchableContext BC, AggregateResult[] groupedResults) {
set<String> setAh = new set<String>();
for (AggregateResult ar : groupedResults) {
System.debug('--------header---' + ar.get('Id__c'));
setAh.add((string) ar.get('Id__c'));
}
system.debug('----------------setAh----------------------'+setAh);
if(!setAh.isEmpty()){
AnalysisSetCodeWsUpdate aw = new AnalysisSetCodeWsUpdate();
aw.updateAnalysisSetCode(setAh);
}
}
global void finish(Database.BatchableContext BC){
//you can also do some after-the-job-finishes work here
}
}