[英]PHP calling Salesforce SOAP API returns Id values that are all the same
I am able to log in to Salesforce through the API in php.我可以通过 php 中的 API 登录到 Salesforce。 Brief Code:
简要代码:
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);
Later, I call a query like this:后来,我调用这样的查询:
$sfqry = "SELECT Id, QualifiedApiName, NamespacePrefix, DeveloperName, MasterLabel, Label, PluralLabel, DefaultCompactLayoutId, IsCustomizable, IsApexTriggerable, IsWorkflowEnabled, IsCompactLayoutable, KeyPrefix, IsQueryable from entitydefinition";
$response = $sfconn->query($sfqry);
I get data results back, the usual 'object' which has a 'records' property.我得到了数据结果,通常是具有“记录”属性的“对象”。 But in looking at the list in records, EVERY single 'Id' value is the same - eg 000000000AAA (15 zeros, 3 A's).
但是在查看记录中的列表时,每个“Id”值都是相同的——例如 000000000AAA(15 个零,3 个 A)。 Other data looks fine (eg QualifiedApiName and other fields are different for each record).
其他数据看起来很好(例如,QualifiedApiName 和其他字段对于每条记录都是不同的)。 I have used the same query in the Salesforce SOQL page and Ids are definitely different - and the other fields match what I'm getting back through my PHP query.
我在 Salesforce SOQL 页面中使用了相同的查询,并且 ID 肯定不同 - 其他字段与我通过 PHP 查询返回的内容相匹配。
I have queried other objects as well, and they too seem to be returning 00000000000AAA for the Id.我也查询了其他对象,它们似乎也为 Id 返回 00000000000AAA。
In the XML file I have set up, I see the base definition of SObject as this:在我设置的 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>
And, of course, I see the other objects being based off that one.而且,当然,我看到其他对象是基于那个对象的。
I've been researching this for over 2 days.我一直在研究这个超过2天。 I'm afraid I may have missed something very basic since I can't find anyone else reporting this problem.
恐怕我可能错过了一些非常基本的东西,因为我找不到其他人报告这个问题。
Id's in EntityDefinition
, FieldDefinition
are so-so, they often return a fake id. Id 在
EntityDefinition
, FieldDefinition
是马马虎虎,他们经常返回一个假的 id。 It's quite interesting topic, read The requested resource does not exist [error] in Salesforce.这是一个非常有趣的话题,请阅读The requested resource does not exist [error] in Salesforce。 What is wrong with Salesforce?
Salesforce 有什么问题? if you want to know more.
如果你想知道更多。
Use DurableId
, QualifiedApiName
etc for uniqueness.使用
DurableId
、 QualifiedApiName
等以获得唯一性。 What do you even need IDs for?你还需要身份证做什么? Some url hacking attempt?
一些 url 黑客尝试? That's not an official API...
那不是官方的 API...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.