Documentation

crm.deal.userfield.update

Scope: catalog Permissions: all

crm.deal.userfield.update(id, fields)

Updates existing user deals field.

Parameters

Parameter Description
id User field ID.
fields Specifies an array of the fields to be updated ("updated field"=>"value"[, ...]), where "updated field" can have values, returned by crm.userfield.fields method.
LIST Contains sets of values for list-type user fields. Indicated when creating/updating the field. Each value is an array with the following fields:
  • VALUE - listed item value. Field is required/mandatory in case when a new item is created.
  • SORT - sorting.
  • DEF - when "Y", list item is a default value. Multiple field type can have several DEF=Y. First value will be deemed as default for single field.
  • XML_ID - value external ID. Parameter is considered only when updating already existing list item values.
  • ID - value identifier. When it's indicated, deemed as an update of existing list item value and not the newly created value. It's needed only when calling *.userfield.update methods.
  • DEL - when "Y", existing list item will be deleted. Applies, when ID parameter is not empty.

Example

var id = prompt("Enter ID");
var label = prompt("Enter new title");
BX24.callMethod(
	"crm.deal.userfield.update", 
	{ 
		id: id,
		fields: 
		{
			"EDIT_FORM_LABEL": label,
			"LIST_COLUMN_LABEL": label
		}
	}, 
	function(result) 
	{
		if(result.error())
			console.error(result.error());
		else
		{
			console.dir(result.data()); 			
			if(result.more())
				result.next();						
		}
	}
);


© «Bitrix24», 2001-2024