Announcement

Collapse
No announcement yet.

Create

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

  • Create

    Hi,
    I need to create a new dashlet for the new entity called AccountOpening

    and I has been created a new json file in this location "espocrm\custom\Espo\Custom\Resources\metadata\das hlets\accountopening.json"
    and this file contains the below code:

    {
    "view":"views/dashlets/abstract/record-list",
    "aclScope": "AccountOpening",
    "entityType": "AccountOpening",
    "options": {
    "fields": {
    "lastName": {
    "type": "varchar",
    "required": true
    }
    },
    "autorefreshInterval": {
    "type": "enumFloat",
    "options": [0, 0.5, 1, 2, 5, 10]
    },
    "displayRecords": {
    "type": "enumInt",
    "options": [3,4,5,10,15,20,30,50]
    },
    "layout": [
    {
    "rows": [
    [
    {"name": "lastName"}
    ]
    ]
    }
    ]
    }
    }

    for now i can add the dashlet on my home screen but when i make any refresh or clear the cache in this case the dashlet disappears and the important thing is that there is no data loaded. So I need to know how can load the data in the dashlet

    Thanks in advanced

  • #2
    Hello

    Now sure, it's what you need
    Code:
    {
        "view":"views/dashlets/abstract/record-list",
        "aclScope": "AccountOpening",
        "entityType": "AccountOpening",
        "options": {
            "fields": {
                "title": {
                    "type": "varchar",
                    "required": true
                },
                "autorefreshInterval": {
                    "type": "enumFloat",
                    "options": [0, 0.5, 1, 2, 5, 10]
                },
                "displayRecords": {
                    "type": "enumInt",
                    "options": [3,4,5,10,15]
                },
                "expandedLayout": {
                    "type": "base",
                    "view": "views/dashlets/fields/records/expanded-layout"
                }
            },
            "defaults": {
                "sortBy": "createdAt",
                "asc": false,
                "displayRecords": 5,
                "expandedLayout": {
                    "rows": [
                        [
                            {
                                "name": "lastName"
                            }
                        ]
                    ]
                }
            },
            "layout": [
                {
                    "rows": [
                        [
                            {"name": "title"}
                        ],
                        [
                            {"name": "displayRecords"},
                            {"name": "autorefreshInterval"}
                        ],
                        [
                            {"name": "expandedLayout"},
                            false
                        ]
                    ]
                }
            ]
        }
    }
    Why do you lastName to option field list?
    Also check if cache folder is writable.

    Comment

    Working...
    X