S
S
Sveuser2022-01-18 08:58:22
Bitrix24
Sveuser, 2022-01-18 08:58:22

CRM Bitrix24 how to select one of the values ​​from the list (custom field) when creating a lead?

Is it possible, using a webhook, to select one of the values ​​from a custom list when creating a deal and pass it as a field value for the parent of this list?

61e64e426b71b092376537.png

61e655f4c04d0924812530.png

none of the options work

# создание лид
    public function addLead(){
        global $domain;

        $fields = array(
            "fields" => array(
                "TITLE" => $this->title,
                "NAME" => "Уточнить имя",
                "OPENED" => "Y",
                "PHONE" => array(
                    array("VALUE" => $this->phone, "VALUE_TYPE" => "WORK")
                ),
              //вариант 1
                "UF_CRM_1620229499581" => "Аренда1",
               //вариант 2
                "UF_CRM_1620229499581" => array(
                    array("VALUE" => "Аренда2",)
                ),          
            ),
            "params" => array("REGISTER_SONET_EVENT" => "Y")
        );
        if($this->contactid) $fields['fields']['CONTACT_ID'] = $this->contactid;
        $fields = $this->addUtms($fields);

        # статус воронки
        $status = get_content("integrations", "bitrix", "status_lead");
        if($status) $fields["fields"]['STATUS_ID'] = $status;
        # овтетсвенный
    $responsible_user = get_content("integrations", "bitrix", "bitrix_contact");
        if($responsible_user) $fields["fields"]['ASSIGNED_BY_ID'] = (int)$responsible_user;
        # создание сделки
        $lead = $this->request('crm.lead.add', $fields);
        # id lead
        $leadID = isset($lead['result']) ? $lead['result'] : 0;

        return $leadID;
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vyacheslav Zhgilev, 2022-01-18
@jazzz

Where are you sending it to?
Into a deal?
If yes, you need to create a 1 in 1 field with the same options in deals
.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question