You need to sign in to do that
Don't have an account?
Vempally
Error: Compile Error: Field is not writeable: Quote.AccountId at line 20 column 9
Hi Everyone,
Following is the code which is giving the said error in test class...
Following is the code which is giving the said error in test class...
@isTest Public Class QuoteDescription_Test{ Static testMethod void test1(){ Account acc1 = new Account(name = 'Account1'); insert acc1; Opportunity opp1 = new Opportunity (); opp1.Name = 'Opportunity1'; opp1.StageName = 'Prospecting'; opp1.CloseDate = Date.newInstance(2016, 2, 6); insert opp1; Account acc = [Select id, name from Account]; Opportunity opp = [Select id, name from Opportunity]; Quote quo1 = new Quote(); quo1.Name = 'Quote1'; quo1.Accountid = acc.id; quo1.Opportunityid = opp.id; insert quo1; quo1.Status = 'Accepted'; update quo1; } }
Let us know if this will help you
All Answers
Let us know if this will help you
Please comment the LINE Nummber 20 i.e. "quo1.Accountid = acc.id;"
Quote will take the account from associated Opportunity by default, as AccountId on Quote is not creatable.
Thanks,
Ajay