Method

findCases — find cases for a specific entity by filtering with entity id

Description

Minimum number of  arguments for this method is two. The first argument is the entity name and the second is the entity id.

Structure of the method:

findCases('Entity Name', 'Entity Id')

Parameters

Entity Name — The entity name like contact

Entity Id— The entity id like the id of a contact

Examples

If you are creating an email template on the contacts entity, you have the contact object captured and can use its information like {{first_name}}, {{id}}, etc.

In the example below, we use the id of the contact to get all its cases.

//Find all cases for a specific contact. 
Hello {{first_name}},

{% set cases = findCases('contact',id)%}
 Your Cases: 

 {% for case in cases%}

    Title: {{case.title}} 

 {%endfor%}

//Output: Lists the title of cases for the contact with its current id

To stay updated with the latest features, news and how-to articles and videos, please join our group on Facebook, Flexie CRM Academy.