This example is triggered everything a Project Task is updated and execute a Workflow from Module “Project” to summarize working hours.

Workflow in Project Task triggered by “on every save”

[vc_gallery interval=”0″ images=”520,522,524″ img_size=”large”]

The workflow will only executed, if a Project is set within the Task. (Should be the default case)
Then the “Execute Workflow with external Record” search the Project Record and execute another Workflow, you see below.

Workflow in module “Projects” triggered by ProjectTask Workflow

[vc_gallery type=”flexslider_slide” interval=”0″ images=”547,539,541,543,545″ img_size=”large”]

This workflow is not executed automatically. (Start Trigger set to “start manually”)

Because we sum the working hour field about multiple records, we net to initialize the variable and set $env[“hours”] to 0.

The “execute Expression with external Record” execute an small script for every record, which match the the condition. (In this case: Tasks, which are related to the current Project ID)
The script will add the value of $projecttaskhours to the current $env[“hours”] variable.

The last step is to set this value to the Project field “Total Working Time”