Announcement

Collapse
No announcement yet.

Refreshing metadata w/o reloading app

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

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

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


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


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


        • #5
          Originally posted by telecastg View Post
          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


          • #6
            Here:
            https://github.com/espocrm/espocrm/b...r/edit.js#L427

            Comment


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

              Comment


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

                Comment


                • #9
                  This worked beautifully. Thank you, Yuri!

                  Comment

                  Working...
                  X