Skip to main content
Version: 1.6.4

Configure Opportunities

Define the general configuration of opportunities on your instance:

  • configure the stages through which opportunities progress;
  • create templates for task chains to automate the processing of opportunities;
  • add scripts for the templates to automatically perform the required logic when opportunities reach certain stages.

Opportunity stages


Prior to the start of the work, you can configure records of the Opportunity Stage (crm_opportunity_stage) table by adding new stages or editing the existing ones. The "out-of-the-box" B2B CRM application provides default opportunity stages described in the Process Opportunities article.

tip

Roles required: crm_admin, admin can create, edit, and delete records. Users with any other "out-of-the-box" B2B CRM role can only read the table's records.

To create an opportunity stage, complete the steps below:

  1. Navigate to CRM → Settings → Opportunity Stages.
  2. Click New and fill in the fields.
  3. Click Save or Save and exit to apply the changes.

Opportunity Stage form fields

FieldMandatoryDescription
NameYAdd the title of the opportunity stage.
Minimum probability of opportunity, %NSpecify the minimum probability of closing the deal in percentage from 0 to 100 for the opportunity to take this stage.
Customer centric stageNSpecify the customer centric stage, in which this opportunity stage is included.

Task chains


The tasks can be created automatically when an opportunity moves to a new sales stage. It allows for automation of business processes. For such tasks, some of the fields are completed automatically: Related record type = Opportunity, Related opportunity, and other fields the completion of which is configured in the template. Use the Opportunity Task Template (crm_task_template) table to configure this system.

tip

Roles required:

  • Create, edit – crm_manager, crm_admin, admin.
  • Read – users with any "out-of-the-box" B2B CRM roles, admin.
  • Delete – crm_admin, admin.

To create an opportunity task template, complete the steps below:

  1. Navigate to CRMSettingsTask Chains.
  2. Click New and fill in the fields.
  3. Click Save or Save and exit to apply the changes.

Opportunity Task Template form fields

FieldMandatoryDescription
ActiveNSelect the checkbox to make the template active. An active template automatically creates tasks when the opportunity is moved to the specified initiating stage and the task creation condition is fulfilled.
NameYAdd the title of the task template.
TableYThe table, to which the task created from this template is added. The field is filled in automatically with the value Task (crm_task).
DescriptionNAdd the description of the template.
Task templateN

Configure the values for the fields of the task created from this template. You can only specify the values for the fields of the specified Table. You can read about the Task form in the Related Actions article.

If the Do not create task checkbox is selected, the field is read-only.

Execute actionNSelect the checkbox to run a script specified in the Action field when the task is created from this template.
ActionY

Specify the script to run when a task is created from this template.

The Action field is only available if the Execute action checkbox is selected.

Sales directionYSpecify the sales direction for the opportunities of which to apply the template. The system automatically fills in the field with the first found sales direction of the current user, but you can change this value.
Initiating stageNSpecify the opportunity stage the transition to which initiates the creation of the task from this template. If this field is empty and the current record is not specified in any other record as the Next task template, the tasks will not be created from this template.

If the current record is specified as the Next task template in another record, the field is hidden from the form. For such records, you will see a corresponding label on the form.

Time for completion in workdaysYSpecify the time to complete the task created from this template. Default value: 3.
Sort orderNSpecify the order of the task in the task chain. This number does not affect the execution order, but you can use it to sort task templates in the list. Default value: 10 or the value in the previous record + 10, if you create the new record through the Next task template field.
Next task templateNSpecify the template that should be used to create the next task in the chain after the task created from the current template moves to the Completed state. You can only select a template that meets all of the following conditions:
  • it is active,
  • it belongs to the same sales direction as the current template,
  • it is not yet a part of the current chain.

If the Do not create task checkbox is selected, the field is read-only.

Task creation conditionNSpecify the condition that needs to be met for the task chain to be launched and the tasks to be created from the template in the condition builder. The condition works only for the first template in the chain when the Initiating stage is reached.

If the record is specified as the Next task template in another record, the field is hidden from the form. For such records, you will see a corresponding label on the form.

Do not create taskNSelect the checkbox to execute the script specified in the Action field when the task chain is launched but not create a task from the template. When the checkbox is selected, the Next task template field is cleared and it becomes read-only.

The Do not create task field is available only if the Execute action checkbox is selected.

Related lists

  • Previous Task Templates – the list of templates in which the current template is specified as the Next task template.

Script actions


You can configure the scripts that should be run when a task is created from a template. It allows for the automation of the opportunity processing. Use the server API methods to create the scripts.

tip

Roles required: crm_admin can create, edit and delete records. Users with the crm_read_admin and crm_manager roles can read the records and the values of all fields except for the Script.

To create a CRM Script Action (crm_script_action), complete the steps below:

  1. Navigate to CRM → Settings → Script Actions.
  2. Click New and fill in the fields.
  3. Click Save or Save and exit to apply the changes.

CRM Script Action form fields

FieldMandatoryDescription
NameNAdd the title of the script action to identify it on the Opportunity Task Template form.
ActiveNSelect the checkbox if the script action is active. An active script action can be selected on the Opportunity Task Template form.
DescriptionNAdd the description of the script action.
ScriptNAdd the script action. You can use methods of the Server-Side API for the script configuration.
Action script example
(function executeCRMAction(opportunity, crmTask, employee) {
opportunity.additional_comments = "Comment was added by CRM Action Script";
opportunity.update();

crmTask.additional_comments = "Comment was added by CRM Action Script";
crmTask.update();

crmTask.additional_comments = employee.display_name;
crmTask.update();
})(opportunity, crmTask, employee);