0

我正在使用 sforce-php 工具包从 salesforce 获取一些对象。我有以下代码:

$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
$mylogin = $mySforceConnection->login(USERNAME, PASSWORD.SECURITY_TOKEN);
$query = "SELECT FirstName from Contact";
$response = $mySforceConnection->query($query);
$queryResult = new QueryResult($response);

foreach ($queryResult->records as $record) {
    print_r($record);
    echo "<br/>";
}

我希望以这种形式返回的对象:

stdClass Object
(
[type] = Contact
[Id] = Array
    (
        [0] =&gt; 003i0000009GZVzAAO
        [1] =&gt; 003i0000009GZVzAAO
    )
[FirstName] = "Some String" 
[any] = <sf:firstname>Some String</sf:firstname>
)

所以我可以得到对象的名字,比如 $record->FirstName

但我得到的是:

stdClass Object
(
[type] = Contact
[Id] = Array
    (
        [0] =&gt; 003i0000009GZVzAAO
        [1] =&gt; 003i0000009GZVzAAO
    )
[any] = <sf:firstname>Some String</sf:firstname>
)

所以我不能得到名字。我可以访问的唯一属性是“任何”。我怎样才能得到一个预期的对象?我应该把重点放在哪里?

4

1 回答 1

0

Make sure your account has permission to access FirstName custom-field via webservice call.

于 2013-05-16T19:03:56.270 回答