S
S
Sergey2021-07-12 11:18:39
Bitrix24
Sergey, 2021-07-12 11:18:39

How to make a selection of all transactions in the final status in B24?

Good afternoon.

How to make a selection by status - I understand:

$deal_list = \App\CRest::call('crm.deal.list', [
      "order"  => [],
      "filter" => [
        "CATEGORY_ID" => 4,
        "STAGE_ID" => "C4:WON",
      ],
      "select" => [],
    ]			
  );


But the question is - that the final status has a certain fork - the transaction was successfully completed or not - and here I don't understand what to pull and how to filter. (In my understanding, the final status of Bitrix is ​​​​abstract and people somehow set up different options for how it ended - success, failures, returns)

I made the output of an array of one transaction, but I don’t see a sign in it:

Array
(
    [result] => Array
        (
            [0] => Array
                (
                    [ID] => 5110
                    [TITLE] => ****
                    [TYPE_ID] => 
                    [STAGE_ID] => C4:WON
                    [PROBABILITY] => 
                    [CURRENCY_ID] => RUB
                    [OPPORTUNITY] => 14350.00
                    [IS_MANUAL_OPPORTUNITY] => N
                    [TAX_VALUE] => 0.00
                    [LEAD_ID] => 
                    [COMPANY_ID] => 0
                    [CONTACT_ID] => 3862
                    [QUOTE_ID] => 
                    [BEGINDATE] => 2021-03-23T03:00:00+03:00
                    [CLOSEDATE] => 2021-04-02T03:00:00+03:00
                    [ASSIGNED_BY_ID] => 16
                    [CREATED_BY_ID] => 16
                    [MODIFY_BY_ID] => 48
                    [DATE_CREATE] => 2021-03-23T18:56:07+03:00
                    [DATE_MODIFY] => 2021-04-28T14:51:52+03:00
                    [OPENED] => N
                    [CLOSED] => Y
                    [COMMENTS] => 
                    [ADDITIONAL_INFO] => 
                    [LOCATION_ID] => 
                    [CATEGORY_ID] => 4
                    [STAGE_SEMANTIC_ID] => S
                    [IS_NEW] => N
                    [IS_RECURRING] => N
                    [IS_RETURN_CUSTOMER] => N
                    [IS_REPEATED_APPROACH] => N
                    [SOURCE_ID] => 
                    [SOURCE_DESCRIPTION] => 
                    [ORIGINATOR_ID] => 
                    [ORIGIN_ID] => 
                    [UTM_SOURCE] => 
                    [UTM_MEDIUM] => 
                    [UTM_CAMPAIGN] => 
                    [UTM_CONTENT] => 
                    [UTM_TERM] => 
                )


Thank you.

Answer the question

In order to leave comments, you need to log in

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

In REST methods, there is no correct way to receive such changes.
The attribute is the "STAGE_SEMANTIC_ID" key, which can be in 4 states:
Empty - unknown
P - transaction in progress (everything from the new stage to the final ones)
S - successfully completed
F - failed
However, in REST methods it is ReadOnly and is read-only, those. it is not filtered.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question