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"[, ...]), where "field" can have values, returned by the crm.productrow.fields method.

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>


© «Bitrix24», 2001-2024
Up