crm.deal.userfield.add
Scope: crm Permissions: for all
crm.deal.userfield.add(fields)
Created new user field for deals.
System limitation for field name - 20 symbols. User field name is supplemented by prefix UF_CRM_, that is the real name length - 13 symbols.
Returns ID that can be identifier by the method crm.deal.userfield.list.
Parameters
Parameter | Description |
---|---|
fields | Set of
fields
At the current moment: ENTITY_ID USER_TYPE_ID FIELD_NAME LIST_FILTER_LABEL LIST_COLUMN_LABEL EDIT_FORM_LABEL ERROR_MESSAGE HELP_MESSAGE MULTIPLE MANDATORY SHOW_FILTER SETTINGS LIST - array("field"=>"value"[, ...]), containing user field description. Contains the field
|
Full description of fields can be returned by calling crm.userfield.fields method.
Example #1
BX24.callMethod( "crm.deal.userfield.add", { fields: { "FIELD_NAME": "MY_STRING", "EDIT_FORM_LABEL": "My string", "LIST_COLUMN_LABEL": "My string", "USER_TYPE_ID": "string", "XML_ID": "MY_STRING", "SETTINGS": { "DEFAULT_VALUE": "Hello, world!" } } }, function(result) { if(result.error()) console.error(result.error()); else console.dir(result.data()); } );
Example #2
BX24.callMethod( "crm.deal.userfield.add", { fields: { "FIELD_NAME": "MY_LIST", "EDIT_FORM_LABEL": "My list", "LIST_COLUMN_LABEL": "My list", "USER_TYPE_ID": "enumeration", "LIST": [ { "VALUE": "Item #1" }, { "VALUE": "Item #2" }, { "VALUE": "Item #3" }, { "VALUE": "Item #4" }, { "VALUE": "Item #5" } ], "XML_ID": "MY_LIST", "SETTINGS": { "LIST_HEIGHT": 3 } } }, function(result) { if(result.error()) console.error(result.error()); else console.dir(result.data()); } );
© «Bitrix24», 2001-2024