Announcement

Collapse
No announcement yet.

custom field 404

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

  • custom field 404

    following https://docs.espocrm.com/development/custom-field-type/

    I have defined a field in meta data as
    "view": "contactreports:views/fields/contactreportlauncher"
    and created a file at
    \client\modules\contactreports\src\views\fields\co ntactreportlauncher.js

    clear cache and browser cache but the view is not being loaded. I get a 404 as it is looking for

    /client/custom/modules/contactreports/src/views/fields/contactreportlauncher.js?r=1674232785​

    why might this be?
    Where is the code that decides where to look and how can I see why it is missing my file?

  • #2
    I think you need to declare your custom modules in the scopes folder (application\Espo\Modules\ContactReports\Resources \metadata\scopes) ContactReports.json if you want it to look for the file in the modules folder and not custom.
    {
    "entity": false,
    "tab": false,
    "acl": false,
    "module": "ContactReports",
    "customizable": false
    }​
    Could you please give it a try?

    Comment


    • #3
      Thanks Kharg. No that didn't work it's still looking in /client/custom/modules.

      Also I have some custom settings that I coded as per:

      and the views are in /client/modules/mysettings and they work!
      I'm really confused !?!

      Comment


      • #4
        Is the field metadata in the custom folder?
        If yes move it to the contactreports module folder in the application folder.

        Edit:
        I think you have to follow one of the 3 folders configuration without mixing them
        Last edited by Kharg; 01-22-2023, 08:42 PM.

        Comment


        • #5
          Thanks Kharg. I think my current setup is not consistent with the "where to put customizations". I'll adjust

          Comment


          • #6
            OK I think I have found the problem.

            When loading views, the javascript seems make to reference to some list of 'internal modules'.

            If you put your module in \application\Espo\Modules\Mymodule then it is considered an 'internal module' and the client path is /client/modules/mymodule
            If you put your module in \custom\Espo\Modules\Mymodule then it is consider non internal and the client path is /client/custom/modules/mymodule

            I think I had out the backend customisation in one place and the front end in the wrong place.

            Comment

            Working...
            X