BX.ready(function () {
const dealId = Number(BX.message('DEAL_ID'));
BX.ajax.runAction('local:crmtools.api.deal.getSummary', {
data: { dealId }
}).then(function (response) {
document.getElementById('summary').textContent = response.data.text;
});
});UI остаётся тонким, бизнес-логика живёт в PHP-action модуля.