簡體   English   中英

PHP 調用 Salesforce SOAP API 返回相同的 ID 值

[英]PHP calling Salesforce SOAP API returns Id values that are all the same

我可以通過 php 中的 API 登錄到 Salesforce。 簡要代碼:

define('USERNAME', getenv(<myuserkey>));
define('PASSWORD', getenv(<mypwkey));
define('SECURITY_TOKEN', getenv(mytokenkey));

$sfconn = new SforceEnterpriseClient();
$sfconn->createConnection('soap/sfwsdl.xml');
$sfconn->login(USERNAME,PASSWORD . SECURITY_TOKEN);

后來,我調用這樣的查詢:

$sfqry = "SELECT Id, QualifiedApiName, NamespacePrefix, DeveloperName, MasterLabel, Label, PluralLabel, DefaultCompactLayoutId, IsCustomizable, IsApexTriggerable, IsWorkflowEnabled, IsCompactLayoutable, KeyPrefix, IsQueryable from entitydefinition";
$response = $sfconn->query($sfqry);

我得到了數據結果,通常是具有“記錄”屬性的“對象”。 但是在查看記錄中的列表時,每個“Id”值都是相同的——例如 000000000AAA(15 個零,3 個 A)。 其他數據看起來很好(例如,QualifiedApiName 和其他字段對於每條記錄都是不同的)。 我在 Salesforce SOQL 頁面中使用了相同的查詢,並且 ID 肯定不同 - 其他字段與我通過 PHP 查詢返回的內容相匹配。

我也查詢了其他對象,它們似乎也為 Id 返回 00000000000AAA。

在我設置的 XML 文件中,我看到 SObject 的基本定義如下:

    <!-- Base sObject (abstract) -->
    <complexType name="sObject">
        <sequence>
            <element name="fieldsToNull" type="xsd:string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
            <element name="Id" type="tns:ID" nillable="true" />
        </sequence>
    </complexType>

而且,當然,我看到其他對象是基於那個對象的。

我一直在研究這個超過2天。 恐怕我可能錯過了一些非常基本的東西,因為我找不到其他人報告這個問題。

Id 在EntityDefinitionFieldDefinition是馬馬虎虎,他們經常返回一個假的 id。 這是一個非常有趣的話題,請閱讀The requested resource does not exist [error] in Salesforce。 Salesforce 有什么問題? 如果你想知道更多。

使用DurableIdQualifiedApiName等以獲得唯一性。 你還需要身份證做什么? 一些 url 黑客嘗試? 那不是官方的 API...

暫無
暫無

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

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