count contacts in entity

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • McBrumm
    Member
    • Jun 2021
    • 56

    count contacts in entity

    I have linked an entity to a contact. They have a n:n relationship.
    Now I would like to enter a formula in the entity that counts the existing contacts in the data record.

    I use the following formula
    averkufe = entity \ countRelated ('contacts');

    The results are wrong. If I enter a contact, it counts 0, if I remove it and the field is empty, it counts 1. What's the correct formula? thanks
  • yuri
    Member
    • Mar 2014
    • 8527

    #2
    The formula is calculated on the record save. Try to re-save the record or on the list view: select record > Recalculate Formula.
    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...