Buttons - List & Detail views.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rawiri
    Member
    • Sep 2021
    • 34

    Buttons - List & Detail views.

    Folks;

    I have added an entity ("Test") with a few fields - It works fine.

    I have then edited /custom/Espo/Custom/Resourses/metadata/clientDefs/Test.json & added:

    Click image for larger version

Name:	image.png
Views:	161
Size:	38.5 KB
ID:	98150
    line 27 (comma) -> line 30

    It works (I have also created the "js" files to add the buttons & action the buttons (this also works fine)

    When I add a new line at 30
    Click image for larger version

Name:	image.png
Views:	131
Size:	6.5 KB
ID:	98151

    It breaks (obviously this "json" is wrong).

    Has anyone added buttons to both the list & detail views of an entity in this manner?

    Regards
    David.
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1605

    #2
    Check your json here: https://jsonlint.com/
    Sometimes, when you copy code, it may happen, that the browser adds hidden characters, which cause the json to be invalid.

    Comment

    • rabii
      Active Community Member
      • Jun 2016
      • 1250

      #3
      Originally posted by rawiri
      Folks;

      I have added an entity ("Test") with a few fields - It works fine.

      I have then edited /custom/Espo/Custom/Resourses/metadata/clientDefs/Test.json & added:

      Click image for larger version  Name:	image.png Views:	12 Size:	38.5 KB ID:	98150
      line 27 (comma) -> line 30

      It works (I have also created the "js" files to add the buttons & action the buttons (this also works fine)

      When I add a new line at 30
      Click image for larger version  Name:	image.png Views:	9 Size:	6.5 KB ID:	98151

      It breaks (obviously this "json" is wrong).

      Has anyone added buttons to both the list & detail views of an entity in this manner?

      Regards
      David.
      You have a wrong syntax there it should not be ("list": "views/test/list") it should be as below:

      PHP Code:
      "views": {
          "detail": "custom:views/test/detail",
          "list": "custom:views/test/list"
      }
      Rabii
      Web Dev

      Comment

      Working...