You need to sign in to do that
Don't have an account?
Kumar G
Please find the error which i am getting in test class : Field is not writeable: OpportunityLineItem.ProductCode at line 30 column 35 and suggest me how to resolve this.
Field is not writeable: OpportunityLineItem.ProductCode
Please find the error which i am getting in test class : Field is not writeable: OpportunityLineItem.ProductCode at line 30 column 35 and suggest me how to resolve this.
Please send your full test class code here.
Or you can simply comment line 30 where you are updating ProductCode.
Like:
//Comment with double slash before the code start.
Regards
suraj
As error indicates "OpportunityLineItem.ProductCode" is a Read only field. You could not write data in this field either in code or manually.
In your code you have written the field like OpportunityLineItem.ProductCode="1234". Remove this and try.
Thanks,
Amol
Please find my Test class code in code sample.
Example:
This code will update the Product code of OpportunityLineItem Because OpportunitylineItem.productCode references the value in the ProductCode field of related Product record.
If it helps You then mark this solution as the best answer.