entity\countRelated filter not working in Formula with field conditions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ashif Malayil
    Senior Member
    • Dec 2023
    • 259

    #1

    entity\countRelated filter not working in Formula with field conditions

    Hi everyone,

    I'm having trouble getting `entity\countRelated` to work with a field filter, even though the equivalent `record\count` works perfectly fine.

    This works:
    totalInboundCalls = record\count('Call', 'direction=', 'Inbound');

    This does NOT work:
    totalInboundCalls = entity\countRelated('cCall', 'direction=', 'Inbound');

    Both are trying to count Call records where direction = 'Inbound'. The only differences are:
    - `entity\countRelated` uses the relationship link name ('cCall') instead of the entity type ('Call')
    - I trying to nt use any Report filter just plain Formula

    Any guidance would be greatly appreciated. Thanks!
  • yuri
    EspoCRM product developer
    • Mar 2014
    • 9765

    #2
    Hi Ashif,

    This function does not support WHERE filters (as per docs). Creating a custom primary filter can be a solution.

    Comment

    Working...