Documentation

catalog.document.element.add

Scope: catalog Permissions to execute: for all

catalog.document.element.add(fields)

Method adds an inventory management product.

Returns added product ID on success.

Parameters

ParameterType Description
fieldsarray Added product parameters. Fields match to the available list of fields.

Example

BX24.callMethod(
    'catalog.document.element.add', 
    {
        'fields': {
            'DOC_ID': 1,
            'STORE_FROM': 0,
            'STORE_TO': 1,
            'ELEMENT_ID': 42,
            'AMOUNT': 10,
            'PURCHASING_PRICE': 25,
        }
    }, 
    function(result)
    {
        if(result.error())
            console.error(result.error());
        else
            console.log(result.data());
    }
);
$result = CRest::call(
    'catalog.document.element.add',
    [
        'fields' => [
            'DOC_ID' => 1,
            'STORE_FROM' => 0,
            'STORE_TO' => 1,
            'ELEMENT_ID' => 42,
            'AMOUNT' => 10,
            'PURCHASING_PRICE' => 25,
        ],
    ]
);

echo '<pre>';
print_r($result);
echo '</pre>';

© «Bitrix24», 2001-2024