We have an API integration which uses the Salesforce cpan module to query data from Salesforce. This module uses the API version 23.0. It works fine when it queries on objects like Account, Contract and Asset. We recently created a new object called ContractAsset which is a junction object between Contract and Asset. The API Profile for this user has Read, Edit and Create permission for this object. The query for this object doesn't work and throws the following error:
INVALID_TYPE: sObject type \'ContractAsset__c\' is not supported.
Below is the query:
SELECT zAsset__c, zContract__r.Support_Code__c FROM ContractAsset__c WHERE zAsset__r.SerialNumber = 'ABCD'
What might be the reason for this? Any suggestions? Below are some connection parameters been used.
$SF_PROXY = 'https://login.salesforce.com/services/Soap/u/8.0';
$SF_URI = 'urn:partner.soap.sforce.com';
$SF_PREFIX = 'sforce';
$SF_SOBJECT_URI = 'urn:sobject.partner.soap.sforce.com';
$SF_URIM = 'http://soap.sforce.com/2006/04/metadata';
$SF_APIVERSION = '23.0';
Edit
Here are few more details on what we have tried:
- I am able to query the object via Workbench. I even tried using the API version 23 of workbench for this.
- This integration has been live for the past 2 years. It is able to query the custom object that was created before the integration started but is unable to query 2 custom objects created after the integration was live. Of course, I haven't tested every custom object but the fact that it is able to query 1 custom object and not the 2 others made me infer this fact.
https://login.salesforce.com/services/Soap/u/37.0
– Mark Pond Aug 5 '16 at 0:46