Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions soapclient/SforceBaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,22 @@ protected function _sendEmail($arg) {
public function convertLead($leadConverts) {
$this->setHeaders("convertLead");
$arg = new stdClass();
foreach ($leadConverts as $k=>$lc) {
if (isset($lc->contactRecord) && !$lc->contactRecord instanceof SoapVar) {
$lc->contactRecord = new SoapVar($lc->contactRecord, SOAP_ENC_OBJECT, 'Contact', $this->namespace);
}

if (isset($lc->opportunityRecord) && !$lc->opportunityRecord instanceof SoapVar) {
$lc->opportunityRecord = new SoapVar($lc->opportunityRecord, SOAP_ENC_OBJECT, 'Opportunity', $this->namespace);
}

if (isset($lc->accountRecord) && !$lc->accountRecord instanceof SoapVar) {
$lc->accountRecord = new SoapVar($lc->accountRecord, SOAP_ENC_OBJECT, 'Account', $this->namespace);
}

$leadConverts[$k] = $lc;
}

$arg->leadConverts = $leadConverts;
return $this->sforce->convertLead($arg);
}
Expand Down