function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ravi Dutt SharmaRavi Dutt Sharma 

AccountId field on Quote object is neither createable nor updateable

I am trying to create a clone functionality which clones the related list records as well. When I clone an account record, I clone the associated quote records also (Quotes are related to account through AccountId field). The cloned quote record has reference to the old account and I need to update the AccountId field to the new account that is cloned by my code. But since the AccountId field on Quote object is neither createable nor updateable, I am getting an exception. Any solution to this?
Thanks in advance for the help.
Best Answer chosen by Ravi Dutt Sharma
@Karanraj@Karanraj
AccountId in the quote object are auto mapped based on the opportunity account information. Go with the following steps 
1. Clone the account record
2. Clone the opportunity and update the account id in opportunity
3. Now clone the quote object and then now update the opportunity id in the quote [automatically it will map the opportunity account Id in the quote accountid field]

All Answers

@Karanraj@Karanraj
AccountId in the quote object are auto mapped based on the opportunity account information. Go with the following steps 
1. Clone the account record
2. Clone the opportunity and update the account id in opportunity
3. Now clone the quote object and then now update the opportunity id in the quote [automatically it will map the opportunity account Id in the quote accountid field]
This was selected as the best answer
Ravi Dutt SharmaRavi Dutt Sharma
Thanks Karanraj