Methods: crm.item.*
Scope: catalog Permissions to execute: for all
Description
Due to each SPA items being stored in an individual table, item IDs for various SPAs may match.
Because of this, you have to pass SPA external identifier entityTypeId
to all methods.
Access permissions
User access permissions are required to use REST methods.
Boolean values
Certain field values are boolean (for example, the field opened
- "Available to everyone").
In this case, you need to pass "Y" or "N" to update the value.
Bind to details
You can use methods [link=3055801]crm.requisite.link.*[/link] to manage binding to details.
Specifics for handling field names
Item field names are stored in the database in UPPER_CASE
format. However, when using REST, we convert them in camelCase
. For example, the field ASSIGNED_BY_ID
is converted to assignedById
.
Custom user fields can contains numerals in addition to letters and the character _
and. Usually, they are indicated separately: for example, the field UF_CRM_10_5186744711
is converted to ufCrm10_5186744711
.
For readability, underscore between digits remains and the rest is removed.
The issues occur when letters and digits are mixed inside the field. For example, UF_CRM_10_DIGIT10
is converted to ufCrm10Digit10
. In case of reverse conversion, you cannot determine, обратном преобразовании нет никакой возможности определить, исходное поле называлось UF_CRM_10_DIGIT10
или UF_CRM_10_DIGIT_10
.
To solve such conflicts, starting from CRM module version 21.1800.0 you can preliminarily analyze the field names, and if conflicts are discovered, the field name is left as is and not converted to camelCase
.
Additionally, any field names in all methods can be passed in both UPPER_CASE
and camelCase
.
For example, the element has two fields: UF_CRM_10_DIGIT_10
and UF_CRM_10_DIGIT10
.
The method crm.item.fields
converts the name of the first field to ufCrm10Digit10
, with second field remaining as UF_CRM_10_DIGIT10
. Additionally, you can use the key upperName
to read the field name in UPPER_CASE
and use it in all methods.
Methods | Description |
---|---|
crm.item.fields | Passes SPA field data. |
crm.item.get | Passes information about SPA item. |
crm.item.list | Returns array with SPA items. |
crm.item.add | Creates new SPA item. |
crm.item.update | Updates SPA item. |
crm.item.delete | Deletes SPA item. |
Starting from CRM version 21.800.0
Now supporting parent fields when reading and updating SPA items.
Each field has code parentId + {parentEntityTypeId}
.
- Method
fields
in the list of fields will pass information about fields with parents. - Methods
get
andlist
will pass parent field values. - Methods
add
andupdate
will support these field values поддерживать изменения значений этих полей.