Documentation

crm.quote.add

crm.quote.add(fields)

Creates a new quote. When the quote must include buyer/seller requisite details (one company can have multiple details), use the method crm.requisite.link.register.

The created quote must specify seller and buyer companies:
COMPANY_ID, when the buyer is a company or CONTACT_ID when the buyer is a contact.
MYCOMPANY_ID - seller.

The identifiers, specified in crm.requisite.link.register and in the created quote must match with buyer and seller.

Parameters

Parameter Description
fields Set of fields - is array ("field"=>"value"[, ...]), containing values of quote fields, where "field" can have values, returned by the crm.quote.fields method.
Note: to find out the required field format, execute the method crm.quote.fields to view the retrieved field format.

Example

BX24.callMethod(
	"crm.quote.add", 
	{
		fields:
		{ 
			"TITLE": "Draft", 
			"STATUS_ID": "DRAFT",
			"OPENED": "Y", 
			"ASSIGNED_BY_ID": 1, 
			"CURRENCY_ID": "USD", 
			"OPPORTUNITY": 5000,
			"COMPANY_ID": 1,
			"COMMENTS": "New quote.",
			"BEGINDATE": "2016-03-01T12:00:00",
			"CLOSEDATE": "2016-04-01T12:00:00"
		}
	}, 
	function(result) 
	{
		if(result.error())
			console.error(result.error());
		else
			console.info("Quote with ID is created" + result.data());
	}
);	


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