Views: 17926
Last Modified: 26.09.2024

Custom field - is a system functionality that permits adding fields that are not included in the standard functionality to system objects.

It is important to distinguis Custom Fields in system modules and properties used in infoblocks, although the term custom fields is used in system forms (a user set up/editing form, infoblock section set up/editing form, and others).

Custom fields is an entity:

  • more multi-purposed, because the fields can be set up for various objects of the system compared to the infoblock properties,
  • more limited in options because this entity admits a small number of data types.

An unlimited number of custom fields can be created for each object. When choosing any type of a custom field, additional setup fields become available for each chosen type.

The application of custom fields in the system to any module is set up using the objects which must be indicated when creating a field. Not all modules have objects for custom fields by default. A developer can create own objects taking into account that GetList methods support only system objects:

Built-in custom field objects
Module Object Description
Kernel USER User
Blogs BLOG_BLOG Blog
BLOG_POSTBlog post
BLOG_COMMENTMessage comment
Tasks TASKS_TASK Tasks
TASKS_SCRUM_ITEM Drive files link
TASKS_TASK_TEMPLATE_CHECKLIST Checklist in templates
TASKS_TASK_CHECKLIST Checklist in tasks
TASKS_TASK_TEMPLATE Templates
Information blocksIBLOCK_N_SECTION iblock sections with ID = N
IBLOCK_N iblock with ID = N
Calendar CALENDAR_EVENT Calendar events
Training LEARN_ATTEMPT Test runs
Social network SONET_GROUP Social network groups
SONET_COMMENT Comments
SONET_LOG Logs
Document library WEBDAV Document library
Forum FORUM_MESSAGE Forum messages
Highload blocks HLBLOCK_N Highload block with ID=N
Commercial catalog PRODUCT * Products
CAT_STOREWarehouses
CAT_STORE_DOCUMENT_A"Stock receipt" inventory object
CAT_STORE_DOCUMENT_S"Stock adjustment" inventory object
CAT_STORE_DOCUMENT_M"Stock transfer" inventory object
CAT_STORE_DOCUMENT_R"Return" inventory object
CAT_STORE_DOCUMENT_D"Write off" inventory object
CAT_STORE_DOCUMENT_U"Cancel reservation" inventory object
Shopping cart RECYCLEBIN_DISK Shopping cart items
CRM CRM_MAIL_TEMPLATE Email templates
CRM_TIMELINE Timeline
CRM_LEAD Leads
CRM_DEAL Deals
CRM_COMPANY Companies
CRM_CONTACT Contacts
CRM_ORDER Orders
CRM_INVOICE Invoices
CRM_(смарт-процесс) SPA
CRM_ACTIVITY workflow activities
CRM_QUOTE Estimates
CRM_LEAD_SPD Leads with binding to shopping cart items
CRM_DEAL_SPD Deals with binding to shopping cart items
CRM_COMPANY_SPD Companies with binding to shopping cart items
CRM_CONTACT_SPD Contacts with binding to shopping cart items
CRM_ORDER_SPD Orders with binding to shopping cart items
CRM_INVOICE_SPD invoices with binding to shopping cart items
CRM_(SPA)_SPD SPAs with binding to sopping cart items
CRM_ACTIVITY_SPD Workflow activities with binding to shopping cart items
CRM_QUOTE_SPD Estimates with binding to shopping cart items
Robotic Process Automation (RPA) RPA_(process id) Automation rule
RPA_COMMENT Comments to automation rule

* — supports custom fields only.

Note: The modules using information blocks can work with objects of custom fields of the Information blocks module.

Creating Fields

Custom fields can often be created on the page Control Panel >Settings > System settings > Custom fields or, preferable, using the link Add user property in the system forms which provide for the standard adding of custom properties:

  • A form to add/edit a user;
  • A form to add/edit a section of an information block;
  • A form to add/edit a blog.

The page Custom fields can be used if the developer knows exactly which object type identifier they require.

Custom fields can be created with various data types. By default, the system provides for the following types:

  • Integer
  • True/False
  • Video
  • Template
  • List
  • Text
  • Date/Time
  • Bind to highload information block elements
  • Link to information block sections
  • Bind to Information block elements
  • Bind to CRM elements
  • Bind to CRM dictionaries
  • File
  • Number
  • Document from Library
  • Link to Employee
  • Revision history file in Document Library
  • Poll

Events can be used for working with custom fields.

Kernel module events used during work with custom fields:

Event Is called Method
OnUserTypeBuildList When the list of custom fields is being built CUserTypeManager::GetUserType
OnUserTypeRightsCheck When verifying the rights of access to custom fields GetRights
OnAfterFetch When the list of custom fields is being built



Courses developed by Bitrix24