Count contacts related to a record

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • olof
    Senior Member
    • Jul 2018
    • 184

    Count contacts related to a record

    I'm trying to count the number of contacts related to a record so I can show it in a records list view..

    entryCount=entity\countRelated('contact')

    What am I doing wrong?

  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hi, check link name again. I think it has to be 'contacts', but check in Entity Manager

    Comment

    • olof
      Senior Member
      • Jul 2018
      • 184

      #3
      Thanks - that works now but it only fires with the record is edited not when a contact is allocated... is there any way to make this fire when a contact is related to it?

      Comment

      • tanya
        Senior Member
        • Jun 2014
        • 4308

        #4
        formula works only after record saved. Seams you need a workflow after Contact created Update related record.

        Comment

        • olof
          Senior Member
          • Jul 2018
          • 184

          #5
          Thanks, that will work.
          Rich

          Comment

          • olof
            Senior Member
            • Jul 2018
            • 184

            #6
            tanya I've just tried to implement but these are not new contacts being created - rather existing contacts being associated with existing records (is a new record type we call buckets).

            Comment

            • tanya
              Senior Member
              • Jun 2014
              • 4308

              #7
              what relationship type is here?
              do you use linkMultiple fields?

              Comment

              Working...