You need to sign in to do that
Don't have an account?
Claiborne
sObjectType.newSObject() with Quote Object
This statement works:
Account acct = (Account)Account.sObjectType.newSObject(null, true);
This one does not.
Quote newQuote = (Quote)Quote.sObjectType.newSObject(null, true);
Any ideas
Account acct = (Account)Account.sObjectType.newSObject(null, true);
This one does not.
Quote newQuote = (Quote)Quote.sObjectType.newSObject(null, true);
Any ideas
Have you Enabled Quotes Settings like below, so that that you able to access the Quote object in you class. kindly refer the image below. by default its not enabled. we have to enable it manually.
Hope this will help you.
Thanks
karthik
The second line, with Quote is flagged with error:
Invalid field sObjectType for sObject Quote
And Quotes are enabled for the org.
your code is working fine in class and execute_anonymous_apex window as well.
Thanks
karthik
In the apex class, I had a global variable, also called quote. It was defined as:
public Quote quote { get; set; }
This worked just fine. I statements like quote = new Quote(); and quote = [select . . . from Quote where Id = : qid];
But you cannot use the statement:
Quote newQuote = (Quote)Quote.sObjectType.newSObject(null, true);
It throws an error and will not save.
The solution was to change my local variable quote to myQuote. So the initialization statement became:
public Quote myQuote { get; set; }
Thanks everyone for helping out.