Below are the different out-of-the-box statecode and statuscode for the Quote table.
Status (statecode) | Status Reason (statuscode) |
0 (Draft) | 1 (Inprogress) |
1 (Active) | 2 (Inprogress) |
3 (Open) | |
2 (Won) | 4 (Won) |
3 (Closed) | 5 (Lost) |
6 (Canceled) | |
7 (Revised) |
Now if we are trying to migrate Quote records that are in either 2(Won) or 3(Closed) status (statecode), our package will fail and we will get the below error.

{“error”:{“code”:”0x80040233″,”message”:”Quote can’t be closed because it is in Draft state. Only Active Quote can be closed. Please activate the Quote and then try to close it.”}} -batchresponse_aa072eca-fd15-4067-8f2b-41f7b3dfad1c– )System.Net.WebException
This is because we cannot directly create the Quote record with the status either Won or Closed.
It will create those records with the status Draft instead.

However we can create Quote records with either Draft or Active status, we will not get the above error.

If we try adding / associate Quote Product to either an Active or Closed Quote, we will get the below error –

: The remote server returned an error: (400) Bad Request. (Error Type / Reason: BadRequest, Detailed Message: {“error”:{“code”:”0x80043b09″,”message”:”The detail cannot be updated because the parent is not editable.“}})System.Net.WebException (Status Reason: BadRequest): The remote server returned an error: (400) Bad Request.”
And as expected with Draft Quote we can associate quote products.


So basically if we are planning to migrate Quote and Quote Product to Dataverse/Dynamics 365
- First, move all the Quote with status as Draft (i.e. do not map statecode and statuscode)
- Then associate Quote Product to it. (also certain fields are only available for update and not create, you could run update Quote Product package to update those fields)
- Next, we can update all the Quote as Active (along with any other fields that are available only for update and not create), and then run another update package to update the actual statecode and statuscode values as now from the Active status we could move to draft or closed status without any issues.
And also please check the CRM Migration Starter Kit for further details and guidance.
Hope it helps..
Discover more from Nishant Rana's Weblog
Subscribe to get the latest posts sent to your email.

One thought on “Data Migration of Quote and Quote Product – few key points (Dataverse/Dynamics 365/ SSIS)”