diff --git a/soapclient/SforceBaseClient.php b/soapclient/SforceBaseClient.php index 3b494c7..4a59196 100644 --- a/soapclient/SforceBaseClient.php +++ b/soapclient/SforceBaseClient.php @@ -578,9 +578,20 @@ public function convertLead($leadConverts) { */ public function delete($ids) { $this->setHeaders("delete"); - $arg = new stdClass(); - $arg->ids = $ids; - return $this->sforce->delete($arg)->result; + if(count($ids) > 200) { + $result = array(); + $chunked_ids = array_chunk($ids, 200); + foreach($chunked_ids as $cids) { + $arg = new stdClass; + $arg->ids = $cids; + $result = array_merge($result, $this->sforce->delete($arg)->result); + } + } else { + $arg = new stdClass; + $arg->ids = $ids; + $result = $this->sforce->delete($arg)->result; + } + return $result; } /**