Documentation

crm.item.batchImport

Scope: catalog Permissions to execute: for all

crm.item.batchImport({entityTypeId: number, $data: ?{})

Entry batch import.

Parameters

Parameter Description
entityTypeIdelement type ID (What entities are supported?)
dataarray with element field values. Can be handled as an array with each element containing set of fields, described in the method crm.item.import.

Method returns array data, containing the same keys, included in the query's array data. Each element of this array will contain the result of specific element import: array item with the identifier of created element on success, or an error message.

Logic for adding the elements works the same as in the method crm.item.import.

Attention! Single query allows importing 20 elements maximum.


Example

Deal import:

{
	"entityTypeId": 2,
	"data": [
		{
			"title": "My deal",
			"categoryId": 0
		},
		{
			"title": ""
		}
	]
}

Result example:
{
	"result": {
		"items": [
			{
				"item": {
					"id": 15
				}
			},
			{
				"error": "CRM_FIELD_ERROR_REQUIRED",
				"error_description": "Field \"Name\" required to complete"
			}
		]
	}
}


© «Bitrix24», 2001-2024