Documentation

crm.requisite.link.register

crm.requisite.link.register(fields)

Registers link between requisite and entity. For successful registration, requisite IDs must belong to a client or a seller, which are selected in the entity, for which the link is being registered. If any of these requisites are unavailable or missing, then their ID is passed as 0 (null). It is permitted to specify all requisite IDs as with null values, then it is deemed that such requisites are not linked to the entity.

Parameters

Parameter Description
fieldsSet of fields - is an array ("field"=>"value"[, ...]), containing values of requisites link fields.

Example

var entityId = prompt("Enter invoice ID");
	var requisiteId = prompt("Enter ID of entity details that belong to buyer");
	var bankDetailId = prompt("Enter ID of bank details that belongs to buyer");
	var mcRequisiteId = prompt("Enter ID of entity details that belongs to company-seller");
	var mcBankDetailId = prompt("Enter ID of bank details the belongs to company-seller");
	BX24.callMethod(
		"crm.requisite.link.register", {
			fields: {
				ENTITY_TYPE_ID: 5,
				ENTITY_ID: entityId,
				REQUISITE_ID: requisiteId,
				BANK_DETAIL_ID: bankDetailId,
				MC_REQUISITE_ID: mcRequisiteId,
				MC_BANK_DETAIL_ID: mcBankDetailId
			}
		},
		function (result)
		{
			if (result.error())
				console.error(result.error());
			else
				console.dir(result.data());
		}
	);



© «Bitrix24», 2001-2022
Up