afterSave Hook requires page refresh to view the updated result

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rkaranth
    Junior Member
    • Feb 2016
    • 22

    afterSave Hook requires page refresh to view the updated result

    Hi,
    I have afterSave logic hook running from my custom module, and the result will be saved in the amount field of the Opportunity module. The calculation is happening correctly and the field is getting updated. But, to view the updated results I have to refresh the page manually.

    Can some one please help me out as to where the js and json files needs to be put, in order to get this working(real time update of the field in opportunity module).
  • yuri
    Member
    • Mar 2014
    • 8453

    #2
    Hi

    Just tested and made sure that refresh is not needed. You can debug.

    application/Espo/Services/Record.php
    application/Espo/Core/ORM/Repositories/RDB.php

    Source is open and code is not spaghetti. Not so difficult to debug.
    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

    • rkaranth
      Junior Member
      • Feb 2016
      • 22

      #3
      Hi,
      I have gone through these files. To be clear, there is a one to many relation between the custom module and opportunities, and I am updating the custom module from bottom-view of Opportunity module detail view. Any other references I can go through to get this running?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8453

        #4
        Relations won't be updated. You can do it in frontend js. Listen to model 'sync' and then this.collecton.fetch();
        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

        • chrisjiang
          Member
          • Dec 2018
          • 88

          #5
          Originally posted by rkaranth
          Hi,
          I have afterSave logic hook running from my custom module, and the result will be saved in the amount field of the Opportunity module. The calculation is happening correctly and the field is getting updated. But, to view the updated results I have to refresh the page manually.

          Can some one please help me out as to where the js and json files needs to be put, in order to get this working(real time update of the field in opportunity module).
          Hi,

          I just read your this post and would like to bother you for help.

          Can you let me know your code of the hook mentioned in your post? I do not know how to get a field update with hook code. Thank you!

          Comment

          Working...