crm.deal.recurring.update
crm.deal.recurring.update(id, fields)
The method updates existing setting for recurring deal template.
Parameters
Parameter | Description |
---|---|
id | Setting ID of recurring deal. |
fields | Set of fields - array("updated field"=>"value"[, ...]) type, where "updated field" can have values returned by the method crm.deal.recurring.fields. |
Example:
var current = new Date(); var nextYear = new Date(); nextYear.setYear(current.getFullYear() + 1); var date2str = function(d) { return d.getFullYear() + '-' + paddatepart(1 + d.getMonth()) + '-' + paddatepart(d.getDate()) + 'T' + paddatepart(d.getHours()) + ':' + paddatepart(d.getMinutes()) + ':' + paddatepart(d.getSeconds()) + '+03:00'; }; var paddatepart = function(part) { return part >= 10 ? part.toString() : '0' + part.toString(); }; var id = prompt("Enter ID"); BX24.callMethod( "crm.deal.recurring.update", { id: id, fields: { "CATEGORY_ID": "2", "START_DATE": date2str(nextMonth), "PARAMS": { "MODE": "single", "SINGLE_BEFORE_START_DATE_TYPE": "day", "SINGLE_BEFORE_START_DATE_VALUE": 5, "OFFSET_BEGINDATE_TYPE": "day", "OFFSET_BEGINDATE_VALUE": 1, "OFFSET_CLOSEDATE_TYPE": "month", "OFFSET_CLOSEDATE_VALUE": 2, } }, }, function(result) { if(result.error()) console.error(result.error()); else { console.info(result.data()); } } );
© «Bitrix Inc.»,
2001-2021,
«Bitrix Inc.», 2021
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.