You need to sign in to do that
Don't have an account?
eto
bug in Sandbox API? SOQL: referenced contact/account objects are always null
When I create a SOQL String like the following, I found a different behaviour for sandbox and live environment:
Select ReferencedContact__c, ReferencedContact__r.Name from SomeObject__c
In the live environment everything works as expected, as I do have access to the referenced contact object and its Name, but when accessing Sandbox, the contact object (and of course the Name field) is always null. (Of course the Contact was added in SF).
This happens for at least references to Account and Contact objects. For references to user objects and custom objects I confirmed, that I do get an object (not null).
I first only tried with Adobe Flex but this can be reproduced in Apex Explorer too, so this seems not to bee an issue with Adobe Flex, but a general problem.
Or maybe I just did something wrong?
regards
Ingo
Select ReferencedContact__c, ReferencedContact__r.Name from SomeObject__c
In the live environment everything works as expected, as I do have access to the referenced contact object and its Name, but when accessing Sandbox, the contact object (and of course the Name field) is always null. (Of course the Contact was added in SF).
This happens for at least references to Account and Contact objects. For references to user objects and custom objects I confirmed, that I do get an object (not null).
I first only tried with Adobe Flex but this can be reproduced in Apex Explorer too, so this seems not to bee an issue with Adobe Flex, but a general problem.
Or maybe I just did something wrong?
regards
Ingo
the request "Select ReferencedContact__c, ReferencedContact__r.Name from SomeObject__c" returns an ID for ReferencedContact__c, but null for ReferencedContact__r.Name in the Sandbox, while it returns an ID and a String in Live environment.
when looking at the SOAP result, the ReferencedContact__r is simply empty or NIL and not a serialized object as it is in live environment.
Soap-Response Sandbox:
<sf:Buyer__c>003S0000002IJnvIAG</sf:Buyer__c>
<sf:Buyer__r xsi:nil="true"/>
Soap-Response Live:
<sf:Buyer__c>0037000000SraspAAB</sf:Buyer__c>
<sf:Buyer__r xsi:type="sf:sObject">
<sf:type>Contact</sf:type>
<sf:Id xsi:nil="true"/>
<sf:Name>Jack Rogers</sf:Name>
</sf:Buyer__r>
I checked the settings and this user did not have access rights to contacts, while it had them in live environment.
I should have checked that before, but it didn't come to my mind. Sorry for that.
Thanks a lot.