I want to create quote instance in custom controller but its giving me an error
Quote q = new Quote();
q.Name = 'quote'; // error variable does not exist: Name
What am I doing wrong?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityI'm not 100% sure as I haven't checked, but I'm pretty sure Quotes will use an autonumber field so you won't be able to set the name like this.
I've run your code in 'execute anonymous' mode in the dev console and it passes ok. If quotes wasn't activated you'd get 'entity is not org-accessible.
If you run the code in dev console do you get the same error as in your controller?
Schema.Quote q = new Schema.Quote(); q.Name = 'quote';