Automated actions (automations)

Automated actions are used to auto-implement a work in our system, it could automatically create a model record or an activity, etc…, all automated action is triggered based on a specific condition.

To create an automated action, navigate to Setting > Technical > Automated Actions > New.

Create New Automated Action

Note

For displaying Technical menu, developer mode needs to be activated and only the user with the Administrator access right of the Setting app can see the automated action menu.

Each automated action needs to be filled with the necessary input data, these data included: the Model, the Trigger, the Apply on, and the Action To Do.

Automated Action Element

Note

To run the automated action, press the Active button.

Model

Choose the model so that when its record has been created or changed, the automated action will be a trigger.

Note

If the automated action is triggered based on time condition, this trigger only depends on time condition, more detail will be mentioned later in this article.

Trigger

Define when the automated action will be triggered. There are six available types of triggers that we can choose.

  • On Creation

  • On Update

  • On Creation & Update

  • On Deletion

  • Based on Form Modification

  • Based on Timed Condition

On Creation

When creating and then saving a new record, the automated action will be triggered.

On Update

When changing and then saving an existing record, the automated action will be triggered.

  • Trigger Fields are used to specify the model’s fields and whenever these fields are changed, an automatic action will be triggered. If we leave it blank, the automated action will be triggered when any model’s field is changed.

  • An automated action can only happen when the record satisfies conditions that are set on Before Update Domain and Apply on.

    • Before Update Domain: Check if the condition is satisfied or not before the record is updated.

    • Apply on: Checks if the condition is satisfied or not after the record is updated.

Example:If you have a Sale Order with a blank Salesperson field, now you want to trigger an automated action when the Salesperson field is set to a specific user, let’s define the Before Update Domain to Salesperson is not set, and the Apply on domain to Salesperson is set.

Before update domain And Apply on

On Creation & Update

When creating a new record or changing an existing record and then saving, the automated action will be triggered.

On Deletion

When deleting an existing record, the automated action will be triggered.

Note

On deletion trigger is rarely used, archiving records is usually a better option.

Based on Form Modification

When the trigger fields are changed by the user even before the records are saved, the automated action will be triggered.

Note

The automated action only run when modifications are made from the user interface, not run if the field is changed through another action and not by the user. This trigger can only be used with the Execute Python Code action.

Based on Timed Condition

When a trigger field’s date or date & time value is reached, the automated action will be triggered.

  • Trigger Date: Choose the field with the date or date time values for to trigger the automated actions.

  • Delay after Trigger Date: Add a number of minutes, hours, days, or months after the trigger date. A negative number can be used to trigger the action before the trigger date.

Example: If you want to send a reminder email 1 day before the quotation’s expiration date, set the Trigger Date to the Expiration (Sale Order) field and set the Delay after trigger date field to -1 Days.

Quotation Reminder Email

Note

By default, the scheduler checks for trigger dates every 4 hours.

Appply on

Define the domain to filter the specific records that the automated action can be applied.

Action To Do

Define what the automated action should do (server action), they could be:

  • Execute Python Code

  • Create a new Record

  • Update The Record

  • Execute several actions

  • Send Email

  • Add Followers

  • Create Next Activity

  • Send SMS Text Message

Execute Python Code

The automated action will execute a Python code script. The code is be written in the Python Code Tab, the available variables are described both on the Python Code tab and the Help tab.

  • Tick Available on the Website field and then add a Website Path to allow to run action through the website.

Tick To Run Action Through Website

Create a new Record

The automated action will create a new record for the Target Model. There are some important fields that you need to pay attention.

  • Target Model: Used to specify the new created record belong to which model.

  • Link Field: Used to link the newly created record to the record that triggers the automated action. For example, you could create and link a new calendar event automatically when a quotation is confirmed.

Target Model And Linked Field
  • Data to Write tab: Used to specify the new record’s values.

    • Field: Select the field to set value.

    • Evaluation Type:

      • Value: used to directly give the field’s raw value in the Value column.

      • Reference: used to select the record in the Record column.

      • Python expression: used to set the field’s value by using Python code in the Value column.

    • Record: Select the record to set as the field’s value.

    • Value: Set the value for the field.

Example: If an automated action creates a calendar event, you can define the event’s name by setting the Field to Display Name (Calendar Event), the Evaluation Type to Value and the Value to any name that you want. Besides that, you can assign a specific user who will be the organizer.

Auto Create Calendar Record

Update The Record

The automated action will update the values for fields of the current model’s record.

Trigger Action When Update Record

Note

Using Data to Write tab is similar to Create a new Record process previously.

Execute several actions

The automated action will trigger other actions at the same time. To set which actions will be run, click on Add a line to select existing actions or create new actions by clicking Create button on Actions popup.

Trigger Execute Several Actions Choose Several Actions

Send Email

The automated action will send an email to a contact linked to a specific record. You can select an existing email template on Email Template field or create a new one if you want.

Action Send Mail

Add Followers

The automated action will add record’s follower by adding existing contacts.

Action Add Follower

Create Next Activity

The automated action will schelude a new activity linked to the record. Using Activity tab for set up purpose.

  • To specific the Responsible person for this activity, there are two options:

    • Always assign to a same person: Set the Activity User Type field as Specific User, then set the Responsible field as any user.

    • Dynamically assign to a person: Set the Activity User Type field as Generic User From Record, then set the User field name as desired, the assigned person will be the same as the user field name field data.

Example: After sale order is created, you want your automated action to set up a call for the user responsible for the sale order. To do so, set the Activity to Call and set the Activity User Type to Generic User From Record, the assgined person is the Salesperson who is set on Sale Order in this case.

Auto Create Call Activity

See also

Related articles