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”
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
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”