Documentation

bizproc.workflow.start

bizproc.workflow.start launches a worfklow

Method Description
TEMPLATE_ID Workflow template ID
DOCUMENT_ID Workflow document ID
PARAMETERS Workflow parameters ID (if the template has parameters)

Example

function startWf(leadId, tplId, cb)
{
   if (!leadId)
   {
      alert('Lead not selected');
      return;
   }

   var params = {
      TEMPLATE_ID: tplId,
      DOCUMENT_ID: ['crm', 'CCrmDocumentLead', leadId],
      PARAMETERS: null
   };

   BX24.callMethod(
      'bizproc.workflow.start',
      params,
      function(result)
      {
         if(result.error())
            alert("Error: " + result.error());
         else if (cb)
            cb();
      }
   );
}

Examples for parameter DOCUMENT_ID:

['crm', 'CCrmDocumentLead', 'LEAD_777']
['crm', 'CCrmDocumentCompany', 'COMPANY_777']
['crm', 'CCrmDocumentContact', 'CONTACT_777']
['crm', 'CCrmDocumentDeal', 'DEAL_777']
['lists', 'BizprocDocument', '777']
['disk', 'Bitrix\Disk\BizProcDocument', '777']
['tasks', 'Bitrix\Tasks\Integration\Bizproc\Document\Task', '777']


© «Bitrix24», 2001-2022
Up