Documentation

crm.deal.update

crm.deal.update(id, fields)

Updated the specified (existing) deal.

Parameters

Parameter Description
id Specifies the deal ID.
fields Specifies an array of the fields to update ("updated field"=>"value"[, ...], see the example below). Each field can be one of those returned by crm.deal.fields.
params Set of parameters. REGISTER_SONET_EVENT - register deal modification event in the activity stream. Additionally, notification will be sent to the responsible for the company..

Example

<script type="text/javascript">
	var id = prompt("Enter the deal ID");
		BX24.callMethod(
			"crm.deal.update", 
			{ 
				id: id,
				fields:
				{ 
					"STAGE_ID": "NEGOTIATION",  
					"PROBABILITY": 70
				}				
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
				{
					console.info(result.data());						
				}
			}
		);	
</script>

Method clarifications

To manage deal contacts, it is recommended to use multiple field CONTACT_IDS:

Example

BX24.callMethod("crm.deal.update", { id: 1, fields: { "CONTACT_IDS": [ 1, 2, 3 ] } });

As a result, the deal will be linked with three specified contacts.

Field CONTACT_ID is an outdated field and is supported to enable reverse compatibility.

Example

BX24.callMethod("crm.deal.update", { id: 1, fields: { "CONTACT_ID": 4 } });

As a result of this call, the link with the specified contact will be added to the deal.

Please, note, that the already existing links with contacts will not be deleted during this process. That is, of the deal was previsouly attached to Contacts 1, 2, and 3, as a result of the this call, it will be attached with contacts 1, 2, 3 and 4.



User Comments

User comments are not part of official documentation. Use information provided by other users in the comments at your own risk.

The User Comments section is not to be used as a feature discussion board. Only registered users can post comments. Your comment will be visible once it has been approved by the moderator.
© «Bitrix Inc.», 2001-2017, «Bitrix Inc.», 2017