I am trying to create a custom view for a group of fields like the name.
I have customized the `Name` field so that it will group the fields salutation, first name, middle name. last name and the suffix name. And it's working fine as expected.
Now, I am trying to create a new view of fields same as Name for the postal code.
I am trying to create a field that will show both zip4 and zip 5 which is read-only.
Files that I have created:
- espocrm/client/custom/src/views/fields/postalCode.js
- espocrm/custom/Espo/Custom/Resources/metadata/fields/postalCode.json
- espocrm/custom/Espo/Custom/Core/Utils/Database/Orm/Fields/PostalCode.php
And the field definition under entity def is,
PHP Code:
"postalCodes": {
"type": "postalCode",
"view": "custom:views/fields/postalCode",
"readOnly": true,
"inlineEditDisabled": true
},
1. The field is able to display the value in the detail view. But in the list view, the field is showing the value undefined. If the zip4 and zip5 fields are added to the list view then the value is displayed.
2. The same problem with the report and the value is not exported.
Findings:
1. The espocrm/custom/Espo/Custom/Core/Utils/Database/Orm/Fields/PostalCode.php is not getting executed. Because of this the
entity->fields['postalCodes']['select'] is not creating a right query.
Can anyone please help me how to fix this? Or Am I missing anything here?
I have customized the `Name` field so that it will group the fields salutation, first name, middle name. last name and the suffix name. And it's working fine as expected.
Now, I am trying to create a new view of fields same as Name for the postal code.
I am trying to create a field that will show both zip4 and zip 5 which is read-only.
Files that I have created:
- espocrm/client/custom/src/views/fields/postalCode.js
- espocrm/custom/Espo/Custom/Resources/metadata/fields/postalCode.json
- espocrm/custom/Espo/Custom/Core/Utils/Database/Orm/Fields/PostalCode.php
And the field definition under entity def is,
PHP Code:
"postalCodes": {
"type": "postalCode",
"view": "custom:views/fields/postalCode",
"readOnly": true,
"inlineEditDisabled": true
},
1. The field is able to display the value in the detail view. But in the list view, the field is showing the value undefined. If the zip4 and zip5 fields are added to the list view then the value is displayed.
2. The same problem with the report and the value is not exported.
Findings:
1. The espocrm/custom/Espo/Custom/Core/Utils/Database/Orm/Fields/PostalCode.php is not getting executed. Because of this the
entity->fields['postalCodes']['select'] is not creating a right query.
Can anyone please help me how to fix this? Or Am I missing anything here?
Comment