Custom Field Types in CRM
If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.
In CRM, you can create fields of two types:
- standard: number, string, date, address, link, file, etc.,
- custom: application integrations within the CRM detail form.
With custom fields, you can:
- display data in the CRM detail form that does not fit standard field types. The field value is stored in Bitrix24, while the application shows it within the field and, if necessary, supplements it with data from its service.
- create interface elements in CRM detail forms. For example, display buttons within the field to control the application.
- integrate external services into the CRM detail form. For instance, display dynamic information in the field. Each time the detail form is opened, the field will make a request to the application handler and automatically load fresh data.
Quick navigation: all methods
User documentation: Custom fields in CRM
Connection with CRM Objects
Custom field types can be added to:
- deals — use methods crm.deal.userfield.add or userfieldconfig.add,
- leads — crm.lead.userfield.add or userfieldconfig.add,
- contacts — crm.contact.userfield.add or userfieldconfig.add,
- companies — crm.company.userfield.add or userfieldconfig.add,
- new invoices — userfieldconfig.add,
- estimates — crm.quote.userfield.add or userfieldconfig.add,
- SPAs — userfieldconfig.add.
In the USER_TYPE_ID field, pass the value in the form rest_#ID_application#_#USER_TYPE_ID#. For example, for an application with ID: 123 and USER_TYPE_ID: userfield1, the value will be rest_123_test_userfield1.
To obtain the application ID, use the method app.info.
Errors When Working with Custom Field Types
Error 400 When Creating a Field
When creating a field with a custom type, you may encounter the error Error! 400: ERROR_CORE: Invalid user type specified. (400).
-
Execute the method userfieldtype.list.
-
If the method returns the field type
USER_TYPE_ID, proceed to step 2. -
If the required field type is not found, register a new type using the method userfieldtype.add.
-
-
Execute the method app.info. This method will check the correctness of the application installation.
-
If the method returns
INSTALLED = true, the application is installed correctly. -
If the method returns
INSTALLED = false, execute the method BX24.installFinish on the application page. This method will complete the installation of the application with the interface.
BX24.init(function(){ BX24.installFinish(); }); -
Error 50x When Loading a Field
If the field was created without errors, but the content is not loading:
-
Check the URL of the handler
HANDLERspecified during field registration using the method userfieldtype.list. To change theHANDLER, use the method userfieldtype.update. -
Ensure that the handler is accessible from the internet:
-
do not use local addresses: localhost, 192.168.* and other addresses accessible only from the local network,
-
check the handler's availability using public "website availability" services.
-
-
Check:
-
the correctness of the SSL certificate if HTTPS is used,
-
the absence of blocks in .htaccess or firewall on the handler's server,
-
the returned HTTP codes; it should be 200 OK.
-
General Recommendations
-
Use the HTTPS protocol for handlers; otherwise, browsers may block the loading of application content.
-
Give clear names to field types: consider the purpose of the field and its connection with the application. The field type cannot be renamed after creation — it can only be deleted and registered again.
Typical use-cases and scenarios
Overview of Methods
Scope:
placement, crmWho can execute the method: administrator
|
Method |
Description |
|
Registers a new type of custom field |
|
|
Modifies the parameters of an existing field type |
|
|
Returns a list of registered field types |
|
|
Deletes a registered field type |