Documentation

crm.lead.update

crm.lead.update(id, fields, params)

Updates the specified (existing) lead.

Important! It is strongly recommended to pass the full set of fields to the update method when updating the address. Specifics of address fields are described here.

Parameters

Parameter Description
id Lead ID.
fields An array in format array("field"=>"value"[, ...]) containing values of the contact fields that need to be updated. The fields can be one or more of those returned by crm.contact.fields.
params Set of parameters. REGISTER_SONET_EVENT - performs registration of a change event in a lead in the activity stream. Additionally, notification will be sent to the responsible for the company.

Example

	var id = prompt("Enter ID");
BX24.callMethod(
	"crm.lead.update", 
	{ 
		id: id,
		fields:
		{ 
			"STATUS_ID": "IN_PROCESS",  
			"CURRENCY_ID": "USD", 
			"OPPORTUNITY": 15500	
		},
		params: { "REGISTER_SONET_EVENT": "Y" }		
	}, 
	function(result) 
	{
		if(result.error())
			console.error(result.error());
		else
		{
			console.info(result.data());						
		}
	}
);


© «Bitrix Inc.», 2001-2017, «Bitrix Inc.», 2017