For every instance of an address, the State is displayed, what is the best way to remove or hide that field?
Announcement
Collapse
No announcement yet.
Change address field, hide or remove province
Collapse
X
-
I think you could edit the fied`s json file, but I did not test it. This would be the approach:
in application/Espo/Resources/metadata/fields go to address.json find
Code:"state": { "type":"varchar", "trim": true, "maxLength": 255, "view": "views/fields/address-state", "customizationOptionsDisabled": true, "pattern": "$noBadCharacters" },
and delete it.
To get it update safe, create a loder fields under custom/Espo/Resources/metadata and copy the altered file there and leave the original as it is.
-
You are right, I tested right now and it does not remove the "state" field.
A workaround could be, that you don not use in your Layout Manager the complete address field but the parts of it that will be generated automatically, when using the adress field. Every field of the one address field is also available as single field,
Comment
-
Originally posted by ITI View PostI was happy when I see the file and your reaction, unfortunally not succesful
I also delete in actualField > "state".
And clear cache. gb whatsapp
Nothing change.
Is there more to be needed to change?Last edited by albertjoseph; 01-03-2023, 11:27 AM.
Comment
-
Define a custom view for the address field type. https://docs.espocrm.com/development/custom-field-type/
In your custom view define custom templates for detail and edit views: https://github.com/espocrm/espocrm/b...address.js#L43
Define a custom function getFormattedAddress1
https://github.com/espocrm/espocrm/b...ddress.js#L159
Assuming you have address format = 1 set in the settings.
Define a custom fetch function w/o state value fetcing. https://github.com/espocrm/espocrm/b...ddress.js#L639
Comment
-
It appears that despite your efforts, the changes you made to the file and cache clearance did not yield the desired results. To troubleshoot further, consider checking other relevant fields, ensuring proper syntax, and confirming that all necessary steps have been followed. If issues persist, seeking technical support or consulting relevant documentation may provide a solution.
Comment
Comment