当我尝试更新现有的潜在客户字段时,却显示以下错误。请帮助我错了。
CODES:
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
$mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
$queryEmail = "SELECT Id, LastName, FirstName, Salutation, Title, Company, Street, City, State, PostalCode, Country, Phone, Email, Website, xxxxx__c FROM Lead WHERE Email='abc@xyz.com'";
$resultEmail = $mySforceConnection->query($queryEmail);
$leadid=$resultEmail->records[0]->Id;
if($leadid!="") {
$fields = array (
'LastName' => 'Update',
'Company' => 'xxxxx xx',
'Title' => 'xyz xyz',
'xxxxx__c' => $resultEmail->records[0]->fields->xxxxx__c.(htmlspecialchars(strip_tags("update Message"), ENT_QUOTES, 'UTF-8')) );
$sObject = new SObject();
$sObject->fields = $fields;
$sObject->type = 'Lead';
$sObject->Id =$leadid;
$createResponse = $mySforceConnection->update(array($sObject));
我收到以下错误。
ERROR:
stdClass Object
(
[errors] => stdClass Object
(
[fields] =>
[message] => cannot reference converted lead
[statusCode] => CANNOT_UPDATE_CONVERTED_LEAD
)
[id] =>
[success] =>
)
答案 0 :(得分:0)
最后,我能够在salesforce professional的帮助下解决问题。
实际上我创建的Lead正在转换为联系人。我正面临这个问题,因为我正在使用潜在客户ID进行更新,同时应使用联系人ID进行更新。随着领导转换为联系人。