Z
Z
Zzpro2021-11-11 16:43:09
Bitrix24
Zzpro, 2021-11-11 16:43:09

How to update a custom field in an order?

Tell me how to update the custom property in the order parameters block through the rest api

As far as I understand, it should work like this, but it does not work. help me please

require_once (__DIR__.'/crest.php');
$result = CRest::call(
    'sale.order.update',
    [
    'id' => '203',
        'fields' => [
            'UF_CRM_1636633709' => 'test',
            'comments' => 'testov',

        ]
    ]


Even when creating, I can not fill in the field

$result = CRest::call(
    'sale.order.add',
    [
        'fields' => [
            'UF_CRM_1636633709' => '203',
      'userId' => '1',
      'personTypeId' => '1',
      'currency' => 'rb',
      'lid' => 's1',
    ]
    ]
);

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Nikolaev, 2021-11-11
@gromdron

I don't think it's possible.
On the backend of the order, UF_* fields are not architecturally used, the store has its own historical heritage. When added to CRM, these fields appear to be on the side, so they are not part of the store itself and you cannot set them using this method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question