Answer the question
In order to leave comments, you need to log in
How to display the names of tasks linked to a deal?
Good afternoon.
There is a need to display in the notification a list of task names that were set in a particular deal.
Manually starts a business process that performs this action.
I was able to display all existing tasks, but I can't figure out how to filter them by deal.
Below is the code we currently have. Tasktest is a BP template variable, I save the selected names into it and send a notification to the user.
\Bitrix\Main\Loader::IncludeModule("tasks");
//\Bitrix\Main\Loader::includeModule('crm');
//CModule::IncludeModule("tasks")
$tasktest = $this->GetVariable("Tasktest");
$arOrder = array();
$arFilter = array();
$arSelect = array("TITLE");
if (\Bitrix\Main\Loader::includeModule('crm')) {
$res = CTasks::GetList($arOrder, $arFilter, $arSelect);
}
$array=[];
while($tasktest = $res->fetch()){
$array[] = $tasktest;
}
$this->SetVariable("Tasktest",$array);
Answer the question
In order to leave comments, you need to log in
I was able to achieve the output of all existing tasks,
how to filter them by the link to the deal.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question