+ Start a Discussion
Shui Tse 11Shui Tse 11 

Error " Invalid Type : sobject 'Custom_Object' is not supported " when trying to create using API

We are working on using SOAP API of Salesforce to create some custom object records. It is working fine in our Developer and Test envournment. However, as soon as we deploy this on production we get this error. This is very strange as all our envoirnemnt as similar in terms of configurations and web access. 

We have checked the following 
Custom Object is in "Deployed" status
Sharing is enabled for the custom object
Generated WSDL from production server and now using it
Please ntote, same solution workst from test and development server
Can anyone point us in right direction as to what can be wrong? Thanking in anticipation.
Daniel BallingerDaniel Ballinger
The short answer here is that you can't directly create Custom Objects, Apex classes, Visualforce pages, etc... directly in a production instance. Try it in the Setup Web UI, it isn't possible.

Instead you need to either create them in a Sandbox org first and deploy them via a change set or use the Metadata API to deploy them as a package.

The rational is that you shouldn't be doing development in a production org. Rather you need to create it elsewhere, test it, then deploy all the components at once to production in a controlled fashion.
Shui Tse 11Shui Tse 11
Hi Daniel,

Thanks for the update. I think i wasnt clear in explaining the issue. Yes, i do not create anything on production. I have a developer account where i develop my application and the deploy the compiled package to the production account. 

What i was talking about the .Net utility that we have created that calls the Salesforce SOAP API was causing issue. When we query the custon object or try to create one using that API it throws the exception. HOwever, same .NET utility deployed on our Test servers is working perfectly fine.

I hope this explains the situation.
Daniel BallingerDaniel Ballinger
Are you using the Partner or Enterprise API to access the record in production?

Does the Invalid object message include the expected __c suffix on the custom objects API name?

If you use a third part tool, such as Workbench to access the production API as the same user, can you see the custom object? It might be a permission issue for the API user.