Hello,
I'm trying to create a custom field derived from the pre-defined address field, named arc-address, within my extension. However, after installing the extension and accessing the entity that includes the new field and its layout, I encounter the following error:
Here is the file structure of my extension:
Contents of App.json:
Contents of client.json:
Contents of arc-address.json:
Contents of arc-address.js:
What I Might Be Missing:
Despite following the setup, EspoCRM still attempts to load `arc-address.js` from the default path (`client/lib/transpiled/src/views/fields/arc-address.js`), resulting in a 404 error. I have verified the following:
1. File Locations:
2. Configuration Files:
3. Cache Cleared and Rebuilt:
Error Details:
Thank you!
I'm trying to create a custom field derived from the pre-defined address field, named arc-address, within my extension. However, after installing the extension and accessing the entity that includes the new field and its layout, I encounter the following error:
Code:
loader.js: GET http://espocrm/client/lib/transpiled/src/views/fields/arc-address.js?r=1734152910 404 (Not Found)
Here is the file structure of my extension:
Code:
MyPlugin/ ├── client/ │ └── custom/ │ └── modules/ │ └── MyPlugin/ │ ├── lib/ │ │ └── js/ │ │ └── views/ │ │ └── fields/ │ │ └── arc-address.js │ └── res/ │ └── templates/ │ └── fields/ │ └── arc-address/ │ ├── detail.tpl │ ├── edit.tpl │ ├── edit-1.tpl │ ├── edit-2.tpl │ ├── edit-3.tpl │ ├── edit-4.tpl │ ├── search.tpl │ └── list-link.tpl └── custom/ └── Espo/ └── Modules/ └── MyPlugin/ └── Resources/ └── metadata/ ├── app/ │ └── client.json ├── clientDefs/ │ └── App.json └── fields/ └── arc-address.json
Contents of App.json:
Code:
{ "fields": { "arc-address": { "view": "MyPlugin:views/fields/arc-address" } } }
Code:
{ "scriptList": [ "__APPEND__", "client/custom/modules/MyPlugin/lib/js/views/fields/arc-address.js" ], "developerModeScriptList": [ "__APPEND__", "client/custom/modules/MyPlugin/lib/js/views/fields/arc-address.js" ] }
Code:
{ "actualFields": [ "street", "number", "complement", "neighborhood", "city", "state", "country", "ddd", "postalCode" ], "fields": { "street": { "type": "text", "maxLength": 255, "dbType": "varchar", "placeholder": "Logradouro" }, "number": { "type": "varchar", "maxLength": 10, "pattern": "$noBadCharacters", "placeholder": "Número", "customizationOptionsDisabled": true }, "complement": { "type": "varchar", "maxLength": 100, "pattern": "$noBadCharacters", "placeholder": "Complemento", "customizationOptionsDisabled": true }, continue... }
Code:
define('MyPlugin:views/fields/arc-address', ['views/fields/address'], function (AddressFieldView) { return AddressFieldView.extend({ detailTemplate: 'MyPlugin:fields/arc-address/detail', listLinkTemplate: 'MyPlugin:fields/arc-address/list-link', searchTemplate: 'MyPlugin:fields/arc-address/search', editTemplate: 'MyPlugin:fields/arc-address/edit', editTemplate1: 'MyPlugin:fields/arc-address/edit-1', editTemplate2: 'MyPlugin:fields/arc-address/edit-2', editTemplate3: 'MyPlugin:fields/arc-address/edit-3', editTemplate4: 'MyPlugin:fields/arc-address/edit-4', continue... }); });
Despite following the setup, EspoCRM still attempts to load `arc-address.js` from the default path (`client/lib/transpiled/src/views/fields/arc-address.js`), resulting in a 404 error. I have verified the following:
1. File Locations:
- `arc-address.js` is correctly placed in `client/custom/modules/MyPlugin/lib/js/views/fields/arc-address.js`.
- Templates are correctly placed in `client/custom/modules/MyPlugin/res/templates/fields/arc-address/`.
2. Configuration Files:
- `App.json` correctly maps the `arc-address` field to my custom view.
- `client.json` includes the path to `arc-address.js` in both `scriptList` and `developerModeScriptList`.
- `arc-address.json` properly defines the additional subfields.
3. Cache Cleared and Rebuilt:
- Ran php command.php clear-cache and php command.php rebuild after making changes.
Error Details:
Code:
loader.js: GET http://espocrm/client/lib/transpiled/src/views/fields/arc-address.js?r=1734152910 404 (Not Found)
Thank you!
Comment