Announcement

Collapse
No announcement yet.

summing values in records from one table to an amount column in another table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • summing values in records from one table to an amount column in another table


    Two tables
    one table DaylyJobs consists dayly working hours by projects

    No,Date, projectname, workhours
    1,01.01.01, proektA, 6.5
    2,01.01.01, proektB,1.5
    2,02.01.01, proektB,2.0

    the second ProjectsConsumedHours consists total hours by projects
    No,projectname, totalours
    1,proektA,6.5
    2,proektA,3.5

    I need to update ProjectsConsumedHours every time when new record in DaylyJobs is added or updated

  • #2
    I would split this in two entities, connect these two by relationship and resolve it by formula.
    So you could have one entity with your projects, another for the jobs.
    This is only a rough idea, because it is not clear, how you realized your tables.

    Comment


    • hristos
      hristos commented
      Editing a comment
      Yes we use two entities one entity with your projects, another for the jobs., DaylyJobs and ProjectsConsumedHour

  • #3
    Have you tried the formula function sumrelated?
    CEO & Founder of Eblasoft.
    Professional EspoCRM development & extensions.

    Comment


    • hristos
      hristos commented
      Editing a comment
      tempsum = entity\sumRelated('jobs', 'workhours', 'projectname') something like that?
Working...
X