Count number of cases on contact
Collapse
X
-
PHP Code:record\update('Contact', contactId, 'countCase', $caseCount + 1);
-
Fantastic. Worked like a charm! I forgot to set "Default" or "Minimum value" for the integer field though but that will solve itself over time. Now the first incoming case for already created contact will change from "Null" to 0 and go up from there. But no biggie :'D
Thank you! -
Yeah possible.
You can create a field (int) in the contact entity and you can simply use formula script to count related case on the contact entity, e.g:
PHP Code:// Assuming that the new field which hold the count is called caseCount
caseCount = entity\countRelated('cases');
PHP Code:ifThen(entity\isNew() && contactId,
$caseCount = record\attribute('Contact', contactId, 'caseCount');
record\update('Contact', contactId, 'countCase', $caseCount + 1);
);
Leave a comment:
-
Count number of cases on contact
I'm creating a contact when a case is created (email-to-case). When looking at the contact-card I can see a list of which Cases that user has sent in.
I would like to have an entity that shows a count on how many cases there is and display it in the Contact list layout. Is this possible?Tags: None
Leave a comment: