簡體   English   中英

如何通過PHP中的Soap Enterprise API在Salesforce中創建帳戶?

[英]How to create an Account in Salesforce via Soap Enterprise API in PHP?

使用enterprise.wsdl使用SOAP API在Salesfoce中創建帳戶時遇到問題

使用此代碼

$mySforceConnection = new SforceEnterpriseClient();
$mySforceConnection -> createConnection("soapclient/enterprise.wsdl.xml");
try {$mySforceConnection -> login(USERNAME, PASSWORD, SECURITY_TOKEN);}
  catch (Exception $e) {echo "Connection not possible<br>";}

  $record = new stdClass();
  $record-> Name = 'test der API';
  $record-> Website = 'www.test.de';
  $response = $mySforceConnection -> create($record,'Account');

得到了錯誤信息:

Notice: Undefined property: stdClass::$result in xyz on line 499

有人可以幫忙嗎? 謝謝

最佳托馬斯

mySforceConnection-> create()期望第一個參數為記錄數組。 將行更改為以下內容可為我解決此問題並成功創建記錄:

$response = $mySforceConnection->create(array($record),'Account');

您可能仍然會收到通知,但是該功能似乎可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM