Skip to content

Latest commit

 

History

History
100 lines (69 loc) · 5.55 KB

File metadata and controls

100 lines (69 loc) · 5.55 KB

Custom Company Fields: Overview of Methods

{% note tip "" %}

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.

{% endnote %}

Custom fields store information about a company in various data formats: string, number, link, address, and others. The group of methods crm.company.userfield.* creates, modifies, retrieves, and deletes such fields, and the events of the subsection notify the application about changes in them.

General information about companies and the other groups of methods is in the section Companies in CRM.

Quick navigation: all methods and events

User documentation: Custom fields in CRM

Types of Custom Fields

Use the method crm.userfield.types to retrieve the available types of custom fields. The method will return the identifier and the name of each type. The identifier is passed in the USER_TYPE_ID field when creating a field.

{
    "ID": "double",
    "title": "Number"
}

Use the method crm.userfield.fields to get a list of characteristics of custom fields. The method will return the codes of the characteristics along with their type and name.

"MANDATORY": {
    "type": "char",
    "title": "Required"
}

Custom Field Settings

Use the method crm.userfield.settings.fields to obtain a list of available settings. The method will return the supported settings for the requested field type.

"DEFAULT_VALUE": {
    "type": "double",
    "title": "Default value"
},
"PRECISION": {
    "type": "int",
    "title": "Precision"
}

Errors When Working with Custom Fields

When creating or deleting custom fields, the request may be interrupted with an error INTERNAL_SERVER_ERROR. This is an internal server error. The cause of the error can be found in the server logs at the time of the request:

  • In cloud Bitrix24, submit a request to technical support to obtain error details.
  • In on-premise Bitrix24, request the server error log from the server administrator or hosting administrator. Then, contact technical support and attach the log for analysis.

Common Causes of Server Errors

  1. Up to 1016 custom fields can be created for companies—this is a limitation of the database architecture. If there are already 1016 fields for companies in Bitrix24, attempting to create a new field will result in an error INTERNAL_SERVER_ERROR when using the method crm.company.userfield.add.

    You can check the number of custom fields for companies using the method crm.company.userfield.list.

  2. There is a limitation on servers for the execution time of a single request—max_execution_time. The standard time is 60 seconds. If the request takes longer, it will be interrupted with an error INTERNAL_SERVER_ERROR.

    The time to create or delete a custom field for a company depends on the number of companies. When a field is created, it is added to all company detail forms. When a field is deleted, it is removed from all detail forms. The fewer companies in your Bitrix24, the faster fields are created and deleted.

    To check the number of companies in Bitrix24, use the method crm.company.list.

Overview of Methods and Events {#all-methods}

Scope: crm

Who can execute the methods: depending on the method

{% list tabs %}

{% endlist %}