Universal Methods for Core Elements
We are still updating this page
Some data may be missing — we will fill it in shortly.
The methods crm.item.* provide capabilities for managing various CRM entities such as leads, deals, contacts, companies, invoices, estimates, and SPA elements. They allow you to retrieve fields, add, update, delete, and get lists of elements.
Features of Working with Field Names
In the database, the names of element fields are stored in UPPER_CASE format. However, when working through REST, we convert them to camelCase. For example, the field ASSIGNED_BY_ID is transformed into assignedById.
Custom field names, in addition to the _ character and letters, can contain numbers. Typically, they are separated, for instance, the field UF_CRM_10_5186744711 is converted to ufCrm10_5186744711.
To make the code more readable, underscores between numbers are retained, while others are removed.
Problems arise when letters and numbers in a field are mixed together. For example, UF_CRM_10_DIGIT10 is transformed into ufCrm10Digit10. When converting back, there is no way to determine whether the original field was named UF_CRM_10_DIGIT10 or UF_CRM_10_DIGIT_10.
To resolve such conflicts, starting from version CRM 21.1800.0, a mechanism for preliminary analysis of field names was implemented. If conflicts are detected, the field name is not converted to camelCase and remains as is.
|
UPPER_CASE |
camelCase |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Starting from version CRM 25.0.0, a parameter useOriginalUfNames was added to the methods crm.item.* to control the format of custom field names in requests and responses:
Y— original custom field names, for exampleUF_CRM_2_1639669411830N— custom field names in camelCase, for exampleufCrm2_1639669411830
By default, custom field names are passed and returned in camelCase.
Binding to Requisites
To manage the binding of requisites, you can use the methods crm.requisite.link.*.
Starting from crm 21.800.0
Support for parent fields when working with CRM elements is introduced.
Each field has a code parentId + {parentEntityTypeId}.
- The
fieldsmethod in the field list will return information about fields with parents. - The
getmethod will return the values of parent fields. - The
listmethod will filter, sort, and include values of parent fields in the selection. - The
addandupdatemethods will support changes to the values of these fields.
REST Methods
- Get Fields of CRM Item `crm.item.fields`
- Create a new CRM entity crm.item.add
- Update CRM Item: crm.item.update
- Delete CRM Item - crm.item.delete
- Get a list of crm.item.list elements
Events on SPA Elements
- Event for Creating a Custom Type CRM Object onCrmDynamicItemAdd
- Event for updating a custom type CRM object onCrmDynamicItemUpdate
- Event for Deleting a Custom CRM Object onCrmDynamicItemDelete