Documentation

crm.deal.productrows.set

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

Creates or updates product entries inside the specified deal.

Parameters

Parameter Description
id Specifies the deal ID.
rows Specifies an array of the products to update or create. Each "field" (see the example below) can be one of the fields returned by crm.productrow.fields.

All the matching product entries that exist when calling the method will be updated with new data. Once the deal is saved, the deal amount is auto calculated.

Example

 
	var id = prompt("Enter the deal ID");
		BX24.callMethod(
			"crm.deal.productrows.set", 
			{ 
				id: id, 
				rows:
				[ 
					{ "PRODUCT_ID": 689, "PRICE": 100.00, "QUANTITY": 4 }, 
					{ "PRODUCT_ID": 690, "PRICE": 400.00, "QUANTITY": 1 } 
				] 
			}, 
			function(result) 
			{
				if(result.error())
					console.error(result.error());
				else
					console.info(result.data());
			}
		);	
</script>
© «Bitrix24», 2001-2022
Up