Example "Creating custom field type" gets error: Uncaught ...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sttn
    Junior Member
    • Apr 2020
    • 29

    Example "Creating custom field type" gets error: Uncaught ...

    When I will create a custom field type like the documentation, I get following error:
    Click image for larger version

Name:	image.png
Views:	0
Size:	52.2 KB
ID:	114730

    The json-File: custom/Espo/Custom/Resources/metadata/fields/fieldcomb.json:
    Code:
    {
        "view": "custom:views/fields/fieldcomb"
    }
    The Javascript-File: client/custom/src/views/fields/fieldcomb.js
    Code:
       define(['views/fields/base'], (BaseFieldView) => {
    
           return class extends BaseFieldView {
          
           // Templates for all view modes.
           // detailTemplateContent = ` ... `;
           // listTemplateContent = ` ... `;
           // editTemplateContent = ` ... `;
           // searchTemplateContent = ` ... `;
    
           setup() {}
    
           afterRender() {}
    
           }
       });​
    At the first step, i will use the default templates. I also test it with own template, i get the same result.

    I add the feid to a test entity with the name CTest over the Administration-Panel:

    Click image for larger version

Name:	image.png
Views:	0
Size:	70.7 KB
ID:	114731
    Layout: ./custom/Espo/Custom/Resources/layouts/CTest/detail.json



    Code:
    [
       {
           "rows": [
               [
                   {
                       "name": "name"
                   },
                   {
                       "name": "fieldCombTest"
                   }
               ]
           ],
           "style": "default",
           "label": "Overview"
       }
    ]
    Entity: custom/Espo/Custom/Resources/metadata/entityDefs/CTest.json:
    Code:
    {
       "fields": {
        ...
           "fieldCombTest": {
               "type": "fieldcomb",
               "isCustom": true
           }
       ...
    ​

    What's my mistake? Doas someone have an idea?
Working...