Documentation

crm.lead.add

crm.lead.add(fields)

Creates and adds a new lead.

Parameters

Note: to find out the required field format, execute the method crm.lead.fields to view the retrieved field format.
To create a repeat lead, specify the values of fields COMPANY_ID or CONTACT_ID. After these fields are set, the flag IS_RETURN_CUSTOMER is set automatically.
Parameter Description
fields Set of fields - is an array ("field"=>"value"[, ...]) containing values of the lead fields.
params Set of parameters. REGISTER_SONET_EVENT - register a lead adding events in the activity stream. Additionally, notification will be sent to the responsible for the contact.

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>


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-2020, «Bitrix Inc.», 2020