Documentation

user.userfield.add

Method adds a user field

Parameters

Parameter Description Available from version
USER_TYPE_ID User field type. Possible values:
  • string - string;
  • integer - integer;
  • double - number;
  • date - date;
  • datetime - date with time;
  • boolean - Yes / No;
  • file - file;
  • enumeration - list;
  • url - link;
  • address - Google map address;
  • money - money;
  • iblock_section - Binding to iblock section;
  • iblock_element - Binding to iblock element;
  • employee - Binding to user;
  • crm - Binding to CRM element;
  • crm_status - Binding to CRM selection list.
Some type have additional settings.

Example

CRest::call(
   'user.userfield.add',
   [
      'fields' => [
         'FIELD_NAME' => 'MY_TEST_FIELD_STR3',
         'USER_TYPE_ID' => 'string',
         'XML_ID' => 'MY_TEST_FIELD_STR_xml',
         'MULTIPLE' => 'Y',
         'SHOW_FILTER' => 'Y',
         'SORT' => 100,
         'LIST_FILTER_LABEL' => 'Title',
         'LIST_COLUMN_LABEL' => 'List Title',
         'EDIT_FORM_LABEL' => 'Title',
         'ERROR_MESSAGE' => 'Title',
         'HELP_MESSAGE' => 'Title',
         'SETTINGS' => [
            'DEFAULT_VALUE' => 'value'
         ]
      ],
   ]
);

Instead of
'LIST_FILTER_LABEL',
'LIST_COLUMN_LABEL',
'EDIT_FORM_LABEL',
'ERROR_MESSAGE',
'HELP_MESSAGE',

indicate the key 'LABEL', to complete the keys above.



© «Bitrix24», 2001-2024
Up