sumRelated reportFilter Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maximus
    Senior Member
    • Nov 2018
    • 2731

    #16
    Hi serqet

    I have a solution for you.
    1. You have already configured Report for Opportunity that do what you want.
    2. For this Report you need to create a report filter. Target Entity of the filter should be Opportunity.
    3. Use this formula to count all records:
    [code]
    test1 = record\count('Opportunity', 'reportFilter5fa541ade1a44984b');
    [code]

    It is better to set this formula into the Workflow's Action to see the proper results change right after the desired action. Or it can be done by a Scheduled Workflow.

    Comment

    • kumaresan
      Junior Member
      • Aug 2018
      • 18

      #17
      Can I Sum the records, for a period let's say for the last 6 months only?

      Let say,
      totalRevenue = entity\sumRelated('opportunities', 'amount', 'won'); only from last 6 months

      Comment

      • Maximus
        Senior Member
        • Nov 2018
        • 2731

        #18
        Hi kumaresan,
        Unfortunately there is no such Formula to get it done. I believe the best option is to solve this with Hook https://docs.espocrm.com/development/hooks/.

        Comment

        Working...