5

It appears that Quote is a SF SObject, yet the following code renders the following error:

[SELECT Id From Quote]

sObject type 'Quote' 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.

The following code throws an NPE on the first line:

SObjectType objType = Schema.getGlobalDescribe().get('Quote');
Map<String, Schema.SObjectField> objectFields = objType.getDescribe().fields.getMap();

So what is a Quote? How do a get a list of them?

Thanks for your help :D

3
  • Can you provide us with more information? Because query you post HAVE TO work. Is it possible that it is used in context of user who can't see this object? Feb 5, 2014 at 20:36
  • I have run this query in a dev org, and in a enterprise org of one of our customers. In the dev org, the query is run from an admin account. In the enterprise org, the query is being run via the rest api (with the full access and refresh token permissions). The api version is 29.0. Feb 5, 2014 at 20:39
  • In both is returning error? How about answer/question from @sfdc_ninja? Feb 5, 2014 at 20:43

1 Answer 1

7

It may seem simple and I'm sorry if I'm wrong, but I suspect you haven't enabled quotes for your org. It is not enabled by default, you have to manually do this step to use quotes.

Setup -> Customize -> Quotes -> Settings -> Enable Quotes

enter image description here

5
  • That might be it. I'll look into that. (I am new to SF, so no answer is too basic. thank you) Feb 5, 2014 at 20:42
  • Following those steps allowed me to run the following line of apex. List<SObject> items = [SELECT Id From Quote]; Thanks for your help. I will have to follow up with the customer to make sure they are talking about Quotes, and not some other SObject like Opportunity. Feb 5, 2014 at 20:52
  • Awesome. Glad to help :) Feb 5, 2014 at 20:54
  • Looks like my customer was referring to Opportunities when they said Quotes. Feb 6, 2014 at 18:53
  • I figured as much. Would have been odd if they were asking you query something they hadn't even activated :) Feb 6, 2014 at 18:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .