Documentation

crm.lead.productrows.set

crm.lead.productrows.set(id, rows)

Creates or updates products for the specified lead.

Parameters

Parameter Description
id Specifies the lead ID.
rows An array in format array("field"=>"value"[, ...]) containing values for the new or existing products that need to be created or updated, respectively. The fields can be one or more of those returned by crm.productrow.fields.

This method will replace all the existing product with new values. Once lead data is updated and saved, the lead totals will be recalculated.

Example

<script type="text/javascript">
	var id = prompt("Enter ID");
		BX24.callMethod(
			"crm.lead.productrows.set", 
			{ 
				id: id, 
				rows:
				[ 
					{ "PRODUCT_ID": 689, "PRICE": 100.00, "QUANTITY": 2 }, 
					{ "PRODUCT_ID": 690, "PRICE": 200.00, "QUANTITY": 1 } 
				] 
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
					console.info(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-2017, «Bitrix Inc.», 2017