Skip to main content
Cartegraph Campus

Automation Example: Display Error Message When Completing a Task if Cost of Other Logs Is Too High

You must have administrator rights to access this feature.

This feature requires a Cartegraph OMS license.

This example automation will display an error message if you try to complete a task if the cost of the other logs is too high.

  1. Click  >Automation Manager.
  2. Click on Create an Automation.
  3. In the Search for Trigger field, enter before task calculation.
  4. Select the trigger titled Verify or perform a calculation before a task is saved.

Next we will extend the trigger:

  1. Click on the trigger Before task is saved to activate it.
  2. In the If field, select Status.
  3. In the Select Operator field, select Is Not.
  4. In the last field, select Completed.

Next we will set properties on some blocks in our automation.

  1. Drag the Aggregate block from the left panel to the Actions section.
  2. In the Properties panel on the right side of the screen, change the title to Cost of Task Other Log.
  3. In the Aggregate field, select Sum.
  4. In the Recordset field, select Task Other Log.
  5. In the Filter field, select Parent Task.
  6. In the Select Operator field, select Is.

We want to compare the  Task ID to the trigger record, so we'll link to it. Click  and select  .

  1. Select Task ID Trigger Record in the corresponding field.
  2. Select the cost field to sum.

An aggregate block always returns a number. We will specify what should happen if the number is greater than 1,000.

  1. Drag the Condition block to the Actions section of the screen; put it under the Cost of Task Other Log  block.
  2. In the Properties panel, change the title to Cost Over $1000.
  3. In the If field, select Cost of Task Other Log.
  4. In the Select Operator field, select Is Greater Than (>).
  5. In the next field, enter 1000.

Next, we will set up our error message.

  1. Drag the Error Message block to the Actions section and nest it under the Cost Over $1000 Condition block.
  2. In the Title field in the Properties panel, enter Other Log cost is over $1,000.
  3. In the Message field, enter, The task cannot be completed because the Other Log cost is over $1,000.

We have nearly finished our automation; to finalize it, we will give it a distinctive name, activate it, and save it.

  1. Click in the existing name near the top of the screen and enter Prevent tasks from being completed if Other Log cost is over 1000.
  2. Activate the automation by sliding the switch to the on position.
  3. Click Save.

NOTE: It's important to Activate and Save to make an automation run. If you have an incomplete automation that you don't want to run yet, you can save the incomplete automation without activating. Later, when you finish it, you should activate it and save it.

  • Was this article helpful?