$dbItems = \Bitrix\Iblock\Elements\ElementXXXTable::getList([
'select' => [ 'ID', 'IBLOCK_ID', 'NAME', 'PREVIEW_PICTURE', 'DETAIL_PAGE_URL'],
'filter' => ['IBLOCK_ID' => 33],
'order' => ['ACTIVE_FROM' => 'DESC'],
]);
$dbItems = \Bitrix\Iblock\Elements\XXXTable::getList([
'select' => [
'ID',
'IBLOCK_ID',
'IBLOCK_SECTION_ID',
'CODE',
'NAME',
'PREVIEW_PICTURE',
'DETAIL_PICTURE',
'DETAIL_PAGE_URL' => 'IBLOCK.DETAIL_PAGE_URL',
],
'filter' => ['IBLOCK_ID' => 777777],
'order' => ['ACTIVE_FROM' => 'DESC'],
]);
$this->arResult['RESULT_SOLUTION_ARR'] = [];
foreach ($dbItems as $element) {
$element['DETAIL_PAGE_URL'] = CIBlock::ReplaceDetailUrl(
$element['DETAIL_PAGE_URL'],
$element,
false,
'E'
);
$this->arResult['RESULT_SOLUTION_ARR'][] = $element;
}
CIBlock::ReplaceDetailUrl()
передав первым аргументом шаблон ссылки, а вторым - массив всех нужные параметров для замены.