Hi,
I tried to update the owner_id of a deal, but failed with the error:
{u'error_message': u'As there are deal items for this deal, you are not able to edit it.'
The deals has deal items, but I don't understand why it prevents from updating the owner_id.
Please help and advise.
Many thanks.
Hi @awicrm!
Thanks for the question. Here is the solution.
To update the deal with deal items 2 fields more are required: has_deal_items
and deal_items
.
Each deal item param must contain al least id
field or whole item body.
For example, to update a deal with deal items, request body may look like this:
{
"owner_id": "5e878b0f7c55711d5b4fce9b",
"name": "NewDealForUser",
"has_deal_items": true,
"deal_items": [
{
"id": "5eb2cb817c5571457897a96f"
},
{
"id": "5eb2cb817c5571457897a96e"
}
]
}
Important: item's position
value will be updated, keep the order same as it is in deal GET response.
@awicrm You can also use partial
and has_deal_items
params, and avoid passing deal_items
list:
{
"owner_id": "5eb2c0027c55714fc19d01b0",
"name": "NewDealForUser",
"partial": true,
"has_deal_items": true
}