Workflow - Run monthly to create Statistics - How to?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • andreschiffer
    Junior Member
    • Nov 2023
    • 9

    Workflow - Run monthly to create Statistics - How to?

    Hey there!

    Following challenge:
    My "Users" are my employees. That for i created an entity "UserStatistics" which is linked n:1 to a "User". In this entity "UserStatistics" i calculate and save the monthly cost and turnover of an user (upon save script) to visualize this in a report on a monthly or quarterly basis. I would like to run a Workflow on every first day of the month which creates one record "UserStatistics" per "User" in the group "Employees", the relation "User" should be set to the respective user.

    I am pretty deep into Espo, Workflows and Formula Script - but now i have no idea how to setup this. My challenge is, that i don't understand the logic behind scheduled workflows and list repots in this case.

    I'd be happy if someone would give me a hint on how to solve this.

    Thank you very much in advance!

    Best regards
    André
  • yuri
    Member
    • Mar 2014
    • 8793

    #2
    Hi Andre,


    My challenge is, that i don't understand the logic behind scheduled workflows and list repots in this case.
    There were more tooltips added for Workflow fields in the recent version. They could be helpful for understanding.

    The logic is simple.

    There is a list report that serves the only purpose – to return a filtered list of records (filters are defined by the report itself).

    A workflow rule runs according its schedule (defined in crontab notation). When the workflow runs, it runs the list report, takes all returned records and runs workflow actions for each of them.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • andreschiffer
      Junior Member
      • Nov 2023
      • 9

      #3
      Hi Yuri,

      i got it - thanks for helping me out! It was lastly pretty simple:

      Workflow from the "User" Entitiy > Create new related Entity > Set Date.

      Thanks!

      Comment

      Working...