S
S
Sergey2020-07-23 16:48:28
Bitrix24
Sergey, 2020-07-23 16:48:28

How to programmatically add a deal in Bitrix24 to the desired category?

Good afternoon.

There is Bitrix 24, I'm trying to add a deal to it:

$result = CRest::call('crm.lead.add', [
      "fields" => [
        "TITLE" => "test 11111",
        "NAME"  => "test 2",
        "LAST_NAME" => "test 3",
        "CATEGORY_ID" => 4,
      ]
    ]
  );


It is being created, but I need to add it to the right category, I meant that the CATEGORY_ID field is responsible for this, but it turned out that it wasn’t. Where is the mistake?

To understand what I mean by a category, its url can be like this: *** /crm/deal/category/4/ and a list of all deals is displayed there.

Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Paimurzin, 2020-07-23
@oldzas

crm.lead.add - this is for leads
and for deals -> crm.deal.add
CATEGORY_ID - everything is correct if used for deals, not for leads, leads do not have directions (categories)
https://dev.1c-bitrix. en/rest_help/crm/cdeals/crm_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question