Documentation

crm.lead.add

crm.lead.add(fields)

Creates and adds a new lead.

Parameters

Parameter Description
fields An array in format array("field"=>"value"[, ...]) containing values of the lead fields.

Example

<script type="text/javascript">
	BX24.callMethod(
			"crm.lead.add", 
			{
				fields:
				{ 
					"TITLE": "FatJoint LLC", 
					"NAME": "Paul", 
					"SECOND_NAME": "A.", 
					"LAST_NAME": "Nibot", 
					"STATUS_ID": "NEW", 
					"OPENED": "Y", 
					"ASSIGNED_BY_ID": 1, 
					"CURRENCY_ID": "USD", 
					"OPPORTUNITY": 12500,
					"PHONE": [ { "VALUE": "555888", "VALUE_TYPE": "WORK" } ] 
				}
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
					console.info("Created a new lead, ID=" + result.data());
			}
		);			
</script>


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