Formula - record\count('Lead', 'status=', list('Assigned', 'In Process'))

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cdmindya
    Junior Member
    • Dec 2020
    • 12

    Formula - record\count('Lead', 'status=', list('Assigned', 'In Process'))

    I have custom entity Projects and project Tasks, ( Relationship: project One-to-Many projectTasks)
    I have to count the number of tasks for a particular project.
    i created 2 projects and assigned 2 tasks each. I created task count field (type: varchar) and used the count function

    taskCount=record\count('ProjectTask', 'status=', list('Not Started', 'Started', 'Ongoing', 'Planned'));

    it is displaying all 4 project tasks irrespective of projects, expected 2 tasks.

    Also only the status filter is fetching the project tasks.

    taskCount=record\count('ProjectTask', projectId );

    Any help
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2

    entity\countRelated(LINK, [FILTER])
    entity\countRelated('opportunities', 'open')

    i think entity\countRelated('opportunities', ['open','Started' ]) can work .. to try.

    for LINK, go entity manager for have the name of relation
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment


    • cdmindya
      cdmindya commented
      Editing a comment
      Thanks, it's working without a filter.

      taskCount=entity\countRelated('projectTasks')
Working...