Documentation

crm.quote.productrows.set

Scope: catalog Permissions to execute: for all

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

Sets (creates or updates) product positions for an estimate.

Parameters

Parameter Description
id Estimate ID.
rows Product positions - is an array ("field"=>"value"[, ...]), where "field" can have values, returned by the crm.productrow.fields method. Product positions for an estimate, that existed prior to calling of the method will be replaced by the new ones. After the modified data is saved and updated, the estimate total amount will be recalculated.

Example

var id = prompt("Enter ID");
BX24.callMethod(
	"crm.quote.productrows.set", 
	{ 
		id: id, 
		rows:
		[ 
			{ "PRODUCT_ID": 1, "PRICE": 100.00, "QUANTITY": 2 }, 
			{ "PRODUCT_ID": 2, "PRICE": 200.00, "QUANTITY": 1 } 
		] 
	}, 
	function(result) 
	{
		if(result.error())
			console.error(result.error());
		else
			console.info(result.data());
	}
);


© «Bitrix24», 2001-2024