Use COUNT with calculated field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tim
    Junior Member
    • Aug 2024
    • 23

    #1

    Use COUNT with calculated field

    I want to add a field to list and detail view of an Account displaying the number of the Contacts. I wonder if I can use calculated field for that purpose? I don't see any sort of COUNT function though.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1729

    #2
    Increment field (number) by default you can only one in database, but Eblasoft has an extension (Number Pro), that you can use for several incremented numbers. Perhaps this would be a solution.

    Comment

    • tim
      Junior Member
      • Aug 2024
      • 23

      #3
      I don't want an increment. I want count, which can only go down. If calculated field is not an option my second guess would be a number field which will be updated by script on Contact save. ?

      Comment

      • item
        Active Community Member
        • Mar 2017
        • 1544

        #4


        is begining for your request

        If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

        Comment

        • yuri
          EspoCRM product developer
          • Mar 2014
          • 9323

          #5
          No, on the database level it's not appropriate to use an aggregate function in a row.
          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

          • yuri
            EspoCRM product developer
            • Mar 2014
            • 9323

            #6
            It's possible to utilize a left join with a sub-query. We did it in sales pack to calculate stock quantity in for a product. I believe it was already covered on the forum before.

            Left-join and a select expression can be added in recordDefs > selectApplierClassNameList​
            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

            Working...