繁体   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