Announcement

Collapse
No announcement yet.

Add Tasks in "Campaigns"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Add Tasks in "Campaigns"

    Hello everybody,
    we just started to learn about all the functions of EspoCRM but first of all:

    Thanks to everybody who made EspoCRM to such a good CRM Tool! We tried many CRM Tools but at the end of the day the decision was easy. EspoCRM is giving us all the functions that we need. So again Thanks to you all that developed and improved the CRM Tool!

    While we started to use the CRM Tool we also have a question that we could not answer ourselves yet:

    Is it possible in EspoCRM to create also tasks for campaigns such as the function for Contacts, Accounts and Opportunities to also have an overview which tasks have to be done in the campaign. We were thinking that this function would help us a lot especially if we start a big marketing campaign for example. With tasks in the Campaign it would not be necessary to create small tasks with every single contact.

    Thank you very much for you help!

  • #2
    Hello,
    Please try to do this:
    1. Create the file /custom/Espo/Custom/Resources/metadata/clientDefs/Campaign.json with this code:
    Code:
    {
        "sidePanels":{
            "detail":[
                "__APPEND__",
                {
                    "name":"tasks",
                    "label":"Tasks",
                    "view":"crm:views/record/panels/tasks",
                    "aclScope": "Task"
                }
            ],
            "detailSmall":[
                "__APPEND__",
                {
                    "name":"tasks",
                    "label":"Tasks",
                    "view":"crm:views/record/panels/tasks",
                    "aclScope": "Task"
                }
            ]
        }
    }
    2. Create the file /custom/Espo/Custom/Resources/metadata/entityDefs/Campaign.json with this code:
    Code:
    {
        "links": {
            "tasks": {
                "type": "hasChildren",
                "entity": "Task",
                "foreign": "parent",
                "layoutRelationshipsDisabled": true,
                "audited": true
            }
        }
    }
    3. Make Clear cache in Administration
    4. Go in Administartion -> Entity Manager -> Task -> Fields -> Parent -> Entity List -> add Campaign -> Save
    5. Press F5 to reload a web page.
    Last edited by Maximus; 01-22-2020, 09:05 AM.

    Comment


    • #3
      Hey Maximus,
      I just saw that I never replied to your answer! It actually worked the way you described it, thank you very much!

      Comment


      • #4
        Hi, i'd like to add tasks too. Do i have to replace the existing json files?
        And: if possible, i'd like to add activities (maybe in english "messages", "notes" or "posts"?) just like in Leads. How do i do that?
        Last edited by p.etrus; 05-19-2022, 09:34 AM.

        Comment


        • rabii
          rabii commented
          Editing a comment
          It is possible, you need to do it via custom code, follow steps below:

          1. Create the file /custom/Espo/Custom/Resources/metadata/clientDefs/Campaign.json with this code:
          Code:
          {
          "sidePanels": {
                "detail": [
                   {
                      "name":"activities",
                      "label":"Activities",
                      "view":"crm:views/record/panels/activities",
                      "aclScope": "Activities"
                   },
                   {
                      "name":"history",
                      "label":"History",
                      "view":"crm:views/record/panels/history",
                      "aclScope": "Activities"
                   },
                   {
                      "name":"tasks",
                      "label":"Tasks",
                      "view":"crm:views/record/panels/tasks",
                      "aclScope": "Task"
                   }
                ],
                "detailSmall": [
                   {
                      "name":"activities",
                      "label":"Activities",
                      "view":"crm:views/record/panels/activities",
                      "aclScope": "Activities"
                   },
                   {
                      "name":"history",
                      "label":"History",
                      "view":"crm:views/record/panels/history",
                      "aclScope": "Activities"
                   },
                   {
                      "name":"tasks",
                      "label":"Tasks",
                      "view":"crm:views/record/panels/tasks",
                      "aclScope": "Task"
                   }
                ]
             }
          }
          2. Create the file /custom/Espo/Custom/Resources/metadata/entityDefs/Campaign.json with this code:

          Code:
          {
              "links": {
                   "meetings": {
                      "type": "hasChildren",
                      "entity": "Meeting",
                      "foreign": "parent",
                      "layoutRelationshipsDisabled": true,
                      "audited": true
                  },
                  "calls": {
                      "type": "hasChildren",
                      "entity": "Call",
                      "foreign": "parent",
                      "layoutRelationshipsDisabled": true,
                      "audited": true
                  },
                  "tasks": {
                      "type": "hasChildren",
                      "entity": "Task",
                      "foreign": "parent",
                      "layoutRelationshipsDisabled": true
                  },
                  "emails": {
                      "type": "hasChildren",
                      "entity": "Email",
                      "foreign": "parent",
                      "layoutRelationshipsDisabled": true
                  }
             }
          }
          3. Make Clear cache in Administration
          4. Go in Administartion -> Entity Manager -> Task -> Fields -> Parent -> Entity List -> add Campaign -> Save
          5. Press F5 to reload a web page.

          This should do it, you will have tasks and activities panels added to the campaign.

      • #5
        OK, will try. But i already have these files. Here's what's in them.

        Should i append the code you gave me to this?

        clientDefs/Campaign.json:
        Code:
        {
        "kanbanViewMode": false,
        "color": "#baec71",
        "iconClass": "fas fa-chart-line"
        
        }
        entityDefs/Campaign.json:
        Code:
        {
        "collection": {
        "orderBy": "createdAt",
        "order": "desc",
        "textFilterFields": [
        "name",
        "firstname",
        "lastname"
        ],
        "fullTextSearch": false,
        "countDisabled": false
        },
        "fields": {
        "status": {
        "options": [
        "Planning",
        "Active",
        "Transformed",
        "Declined",
        "Closed"
        ],
        "style": {
        "Planning": null,
        "Active": "primary",
        "Transformed": "success",
        "Declined": "danger",
        "Closed": "info"
        }
        },
        "type": {
        "options": [
        "Email",
        "Newsletter",
        "Web",
        "Mail",
        "Telephone"
        ],
        "style": {
        "Email": null,
        "Newsletter": null,
        "Web": null,
        "Mail": null,
        "Telephone": null
        }
        },
        "name": {
        "options": []
        },
        "firstname": {
        "type": "varchar",
        "trim": true,
        "options": [],
        "isCustom": true,
        "required": false
        },
        "lastname": {
        "type": "varchar",
        "trim": true,
        "options": [],
        "isCustom": true,
        "required": false
        },
        "telephone": {
        "type": "varchar",
        "trim": true,
        "options": [],
        "isCustom": true
        },
        "email": {
        "type": "varchar",
        "trim": true,
        "options": [],
        "isCustom": true
        },
        "adress": {
        "type": "address",
        "isCustom": true
        },
        "title": {
        "type": "varchar",
        "trim": true,
        "options": [],
        "isCustom": true
        },
        "website": {
        "type": "url",
        "isCustom": true
        }
        }
        }

        Comment


        • rabii
          rabii commented
          Editing a comment
          it is clear,
          1- first code should be added to clientDefs/Campaign.json
          2- second code should be added to entityDefs/Campaign.json
      Working...
      X