S
S
Sergey2020-11-17 12:50:18
API
Sergey, 2020-11-17 12:50:18

Get a list of deals in Bitrix42 via ajax?

There is a task in Bitrix 24, in the "Projects" card, add a new "Services" tab, which should display a list of deal cards that have the current project in the "Project" field.

I add a tab like this:

$this->arResult['TABS'][] = array(
          'id' => 'tab_servise',
          'name' => Loc::getMessage('CRM_COMPANY_TAB_SERVISE'),
          'loader' => array(
            'serviceUrl' => '/local/components/vvip/crm.deal.list/lazyload.ajax.php?&site'.SITE_ID.'&'.bitrix_sessid_get(),
            'componentData' => array(
              'template' => '',
              'params' => array(
                'DEAL_COUNT' => '20',
                'PATH_TO_DEAL_SHOW' => $this->arResult['PATH_TO_DEAL_SHOW'],
                'PATH_TO_DEAL_EDIT' => $this->arResult['PATH_TO_DEAL_EDIT'],
                'INTERNAL_FILTER' => array('COMPANY_ID' => $this->entityID),
                'INTERNAL_CONTEXT' => array('COMPANY_ID' => $this->entityID),
                'GRID_ID_SUFFIX' => 'COMPANY_DETAILS',
                'TAB_ID' => 'tab_servise',
                'NAME_TEMPLATE' => $this->arResult['NAME_TEMPLATE'],
                'ENABLE_TOOLBAR' => true,
                'PRESERVE_HISTORY' => true,
                'ADD_EVENT_NAME' => 'CrmCreateDealFromCompany'
              )
            )
          )
        );


An empty table appears in the corresponding tab, but the list of deals is not shown.
'serviceUrl' => '/local/components/vvip/crm.deal.list/lazyload.ajax.php?&site'.SITE_ID.'&'.bitrix_sessid_get(), is the copied Bitrix component.
How to fix the code so that at least a list of deals appears, and how to filter these deals by a specific project?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question