Answers.Body: <p>I know this is like two years later but I just went through a really similar problem and there's no answer here yet...</p>
  
  <p>First off Coleman posts a good answer here for lots of situations: <a href="https://civicrm.stackexchange.com/questions/165/can-i-update-requery-a-custom-field-that-got-changed-via-another-field-on-the-sa">Can I update/requery a custom field that got changed via another field on the same page?</a></p>
  
  <p>I couldn't get this to work with certain ajax-y elements like the "disable" button under the relationships tab (we had a tab of custom fields that calculate values from other contacts based on relationships, when those relationships aren't active the data recalculates and we want it to display current values).</p>
  
  <p>I worked around this by adding a JS file in <code>hook_civicrm_summary</code>, where the JS asks our custom data to reload every time you click the tab, so you always get current values at a slight performance cost. I'd imagine you could do this with an inline header as well:</p>
  
  <pre><code>  CRM.$(function($) {
      $('#ui-id-22').click(function(){
        CRM.refreshParent($('#Site_Demographics_1_2760'));
      });
    });
  </code></pre>
  
  <p>Where '#ui-id-22' was our tab link and '#Site_Demographics_1_2760' was the panel we wanted to update.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-03-06T17:48:25.593Z
Answers.LastActivityDate: 2019-03-06T17:48:25.593Z
Answers.UserDisplayName: Eli Lisseck
Body: <p>In our CiviCRM instance, the value of a some contact custom field can be retrieved by calling an external API.</p>
  
  <p>So I implemented hook_civicrm_summaryActions. If the user clicks on a custom action I added, a popup form appears with the generated result (or error messages). The external API is called, and the result is saved in our custom field.</p>
  
  <p>If the user then clicks 'OK', the form disappears, so the contact summary is shown again, but the value in the custom field is not updated until the user reloads the page in his browser.</p>
  
  <p>Is anyone aware of a way to make the 'calling' page refresh after the user clicks 'ok'? Another option would be to replace the popup form by an ordinary full screen form (anybody knows how to do that for a summary action?), and redirect after the form has been submitted. Or maybe there are better ways to achieve my goal than with summary actions.</p>
  
  <p>Any suggestion is much appreciated.</p>
  
  <p>Thx,
  Johan</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-07T15:32:43.570Z
Comments.Text: Add some JS, with a call to location.reload() in the onclick event of the OK button?
Comments.UserDisplayName: naomi
Tags: <forms><user-experience><actions>
Title: How do I force a reload after a CiviCRM summary action?
ThreadText: # How do I force a reload after a CiviCRM summary action?
  
  (Asked by: username_0 on 2016-11-29)
  
  In our CiviCRM instance, the value of a some contact custom field can be retrieved by calling an external API.
  
  So I implemented hook\_civicrm\_summaryActions. If the user clicks on a custom action I added, a popup form appears with the generated result (or error messages). The external API is called, and the result is saved in our custom field.
  
  If the user then clicks 'OK', the form disappears, so the contact summary is shown again, but the value in the custom field is not updated until the user reloads the page in his browser.
  
  Is anyone aware of a way to make the 'calling' page refresh after the user clicks 'ok'? Another option would be to replace the popup form by an ordinary full screen form (anybody knows how to do that for a summary action?), and redirect after the form has been submitted. Or maybe there are better ways to achieve my goal than with summary actions.
  
  Any suggestion is much appreciated.
  
  Thx,
  Johan
  
  **Tags:** forms, user-experience, actions
  
  > **Comments:**
  > **username_1**: Add some JS, with a call to location.reload() in the onclick event of the OK button?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-03-06. Score: 1
  
  I know this is like two years later but I just went through a really similar problem and there's no answer here yet...
  
  First off Coleman posts a good answer here for lots of situations: [Can I update/requery a custom field that got changed via another field on the same page?](https://civicrm.stackexchange.com/questions/165/can-i-update-requery-a-custom-field-that-got-changed-via-another-field-on-the-sa)
  
  I couldn't get this to work with certain ajax-y elements like the "disable" button under the relationships tab (we had a tab of custom fields that calculate values from other contacts based on relationships, when those relationships aren't active the data recalculates and we want it to display current values).
  
  I worked around this by adding a JS file in `hook_civicrm_summary`, where the JS asks our custom data to reload every time you click the tab, so you always get current values at a slight performance cost. I'd imagine you could do this with an inline header as well:
  
  ```
    CRM.$(function($) {
      $('#ui-id-22').click(function(){
        CRM.refreshParent($('#Site_Demographics_1_2760'));
      });
    });
  
  ```
  
  Where '#ui-id-22' was our tab link and '#Site\_Demographics\_1\_2760' was the panel we wanted to update.
  
  
  ---
  
  