Битрикс24
9
Вклад в тег
BX24.callMethod('crm.deal.list', {
filter: {
CONTACT_ID: 1
}
}, result => console.log(result));
$arOrder = ["ID" => "DESC"]; // сортировка
$arFilter = ["UF_DEAL_ID" => $dealId]; // фильтрация по ID сделки
$arSelect = ["ID", "UF_DEAL_ID"]; // какие поля выбрать
$invoices = CCrmInvoice::GetList($arOrder, $arFilter, false, false, $arSelect);
while($invoice = $invoices->Fetch()) {
// ваш код
}
use Bitrix\Main\Web\HttpClient;
use Bitrix\Main\Web\Json
$client = new HttpClient;
$webhook = "https://webhook_url/crm.invoice.list";
$params = [
"filter" => $arFilter,
"order" => $arOrder
];
$request = $client->post($webhook, Json::encode($params));
$result = Json::decode($request);
foreach($result["result"] as $res) {
// ваш код
}
BX24.resizeWindow(document.body.clientWidth, document.getElementsByClassName("workarea")[0].clientHeight)