You need to sign in to do that
Don't have an account?
sObject type is not supported
Hello,
I am pretty new to SOQL and I am trying to write a query
List<SObject> quotes = [SELECT Id, Name, QuoteId, Document FROM QuoteDocument];
and I get an error:
"sObject type 'QuoteDocument' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names."
I am trying to build a package and I would like to get the list QuoteDocument if it exists in the Organization and also list should be empty if Quotes are disabled for the organization. How can rewrite the statement to achieve this?
Thank you in advance.
All Answers
List<QuoteDocument> quotes = [SELECT Id, Name, QuoteId, Document FROM QuoteDocument];
Try with below code it will help !! Let me know if it helps !!
Thanks
Manoj
You need to use API name to get the result. Use the following query for resolution.
List<QuoteDocument__c> quotes = [SELECT Id, Name, QuoteId, Document FROM QuoteDocument__c];
Let me know if this helps!
Regards
Sampath
Thank you everyone talking time in my issue.
But I need a way to detect it SOQL query.Sampath, QuoteDocument is not a custom object but it is Salesforce object like Account, Case, Lead etc which can be enabled by Setup -> App Setup -> Customize -> Quotes -> Quote Settings. I get this error only if Quotes are disabled for that organization and I can detect it using:
Amit & Manoj, Thank you for replying.
Those queries will not work as we are referencing QuoteDocument directly. You can test it by excuting it in Developer Console -> Debug -> Anonymous Window.
If you disable Quotes using following setting:
Setup -> App Setup -> Customize -> Quotes -> Quote Settings
and you would get the following error.
I am getting this error can some one please help in resolving this error