Announcement

Collapse
No announcement yet.

Add Tasks to Product entity

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

  • Add Tasks to Product entity

    Is it possible to add Tasks side panel to Product entity?

  • #2
    Hello,
    I think it is possible to do this by the following workaround:

    Step 1, Create Relationship.
    Administration >Entity Manager >Product>Relationships>Many-to-Many>Tasks, check the box 'Link Multiple Field';
    Step 2, Add this field to the layout.
    Administration >Entity Manager >Product>Layouts> Side Pannel Fields.

    Comment


    • #3
      Thank you, it is possible, but I would like to know if there is standard way to enable it.

      Comment


      • #4
        Hi Jakub,
        What do you mean under the 'standard way'?

        Anyway, if you want the Task's side panel to look like in the Contact entity, then you need to add it via the code.

        Comment


        • #5
          Ok, that is the answer. The "standard way" is it look like in contact entity. Thank you

          Comment


          • #6
            Tips on your "standard way" request:
            1. Create the file /custom/Espo/Custom/Resources/metadata/clientDefs/Product.json:
            Code:
            {
                "sidePanels": {
                    "detail": [
                        {
                            "name": "tasks",
                            "label": "Tasks",
                            "view": "crm:views/record/panels/tasks",
                            "aclScope": "Task"
                        }
                    ]
                }
            }
            2. In the file /custom/Espo/Custom/Resources/metadata/entityDefs/Product.json add a link to the Task:
            Code:
            {
                "fields": {
                    //possible custom fields description
                },
                "links": {
                    "tasks": {
                        "type": "hasChildren",
                        "entity": "Task",
                        "foreign": "parent",
                        "layoutRelationshipsDisabled": true
                    }
                }
            }
            3. Administration -> Clear Cache
            4. Reload a web page

            Perhaps you will also need to open Administration -> Entity Manager -> Taks -> Relationship -> Children-to-Parent relationship -> Edit -> add Products to the Parent Entity Types scope/

            Comment


            • #7
              Great, thank you, works perfect.

              Comment

              Working...
              X