Announcement

Collapse
No announcement yet.

Change address field, hide or remove province

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

  • Change address field, hide or remove province

    For every instance of an address, the State is displayed, what is the best way to remove or hide that field?

  • #2
    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.

    Comment


    • #3
      I was happy when I see the file and your reaction, unfortunally not succesful
      I also delete in actualField > "state".
      And clear cache.

      Nothing change.

      Is there more to be needed to change?

      Comment


      • #4
        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


        • #5
          Originally posted by ITI View Post
          I 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?
          if you are unable to hide or remove your state or full address, So What about changing the state or full address and adding wrong state or address which is also similar to hide it.
          Last edited by albertjoseph; 01-03-2023, 11:27 AM.

          Comment


          • #6
            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


            • #7
              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

              Working...
              X