Refreshing metadata w/o reloading app

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • planetrocke
    Junior Member
    • Feb 2017
    • 25

    Refreshing metadata w/o reloading app

    I have a function which adds options to an enum field, and I want to have it reflected in the UI without having to refresh the entire page. Any ideas?
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    I think, this is not possible, because there are some actions in espoCRM, that work only after save. I use for similar problem, where I need to refresh the page the workaround described here.
    Hi, I have an entity, wher some related fields do not recalculate, when I make chnages to them, e.g. deleting the related link. There are some fields, that would not empty in that case. When I recalculate the formula in the list view drop-down, it recalculates correctly. Is there a way to achieve this by formula or in another

    See especially Post #7 to create arefresh button in the entity itself.

    Comment

    • planetrocke
      Junior Member
      • Feb 2017
      • 25

      #3
      Thank you for that. It doesn't work for me. I am looking to emulate what happens when you save in fieldManager. I am doing exactly what it does in terms of posting to field manager update, metadata, and I18n. It is something else that's going on after that which refreshes cache. I've tried to use cache.clear(), model.fetch(), neither works. I have to hard-reload the page to get my new options to show up.

      Comment

      • telecastg
        Active Community Member
        • Jun 2018
        • 907

        #4
        I don't think that is possible update metadada values without reloading the page.

        As I understand, all json metadata files are actually consolidated into one metadata json object stored as data/cache/metadata.php when the page loads and that object will not be updated unless you choose not to use cache for the whole application (which I wouldn't recommend because it will make everything much slower).

        If you want, post your custom function and I or some other participants may be able to offer suggestions to accomplish your goal.

        Comment

        • planetrocke
          Junior Member
          • Feb 2017
          • 25

          #5
          Originally posted by telecastg
          I don't think that is possible update metadada values without reloading the page.

          As I understand, all json metadata files are actually consolidated into one metadata json object stored as data/cache/metadata.php when the page loads and that object will not be updated unless you choose not to use cache for the whole application (which I wouldn't recommend because it will make everything much slower).

          If you want, post your custom function and I or some other participants may be able to offer suggestions to accomplish your goal.
          OK, I am wondering how the fieldManager does this then... when I add an option to an enum, the page does not reload, but yet I get the new option when I go to the field on create/edit on that entity.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8440

            #6
            Here:
            https://github.com/espocrm/espocrm/b...r/edit.js#L427
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • telecastg
              Active Community Member
              • Jun 2018
              • 907

              #7
              Thanks Yuri
              Last edited by telecastg; 02-08-2021, 06:24 PM.

              Comment

              • planetrocke
                Junior Member
                • Feb 2017
                • 25

                #8
                What! Thanks. I will give this a shot.

                Comment

                • planetrocke
                  Junior Member
                  • Feb 2017
                  • 25

                  #9
                  This worked beautifully. Thank you, Yuri!

                  Comment

                  Working...