Answers.Body: <p>To clear all status messages and prevent them from being shown to the user, you can do:</p>
  
  <pre><code>CRM_Core_Session::getStatus(TRUE);
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-02T19:53:49.803Z
Answers.Text: you are my hero, thanks!!  For those, who've been asking for exact code example, here is it:    
    **(new CRM_Core_Session)->getStatus(TRUE);**
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-02T01:21:25.273Z
Answers.LastActivityDate: 2016-03-02T01:21:25.273Z
Answers.UserDisplayName: Coleman
Body: <p>Trying to figure out an answer to <a href="https://civicrm.stackexchange.com/questions/9698/refresh-page-after-closing-modal-opened-by-crm-popup-outside-of-civicrm">this question</a>, have tried to just disable a default CRM.alert using <code>CRM_Core_Session::setStatus(null, false);</code>  in hook_postProcess (defined in a drupal module), but alert still pops up (not a problem generally, it pops up in a default style, would like to use  <strong>CRM.status</strong>  instead, which works perfectly even outside of CiviCRM, while CRM.alert doesn't).
  Any advice, please! </p>
  
Tags: <drupal><hooks><ajax><ui>
Title: Suppress default CRM.alert in hook_postProcess
ThreadText: # Suppress default CRM.alert in hook_postProcess
  
  (Asked by: username_0 on 2016-03-01)
  
  Trying to figure out an answer to [this question](https://civicrm.stackexchange.com/questions/9698/refresh-page-after-closing-modal-opened-by-crm-popup-outside-of-civicrm), have tried to just disable a default CRM.alert using `CRM_Core_Session::setStatus(null, false);` in hook\_postProcess (defined in a drupal module), but alert still pops up (not a problem generally, it pops up in a default style, would like to use **CRM.status** instead, which works perfectly even outside of CiviCRM, while CRM.alert doesn't).
  Any advice, please!
  
  **Tags:** drupal, hooks, ajax, ui
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-02. Score: 2 | Accepted answer
  
  To clear all status messages and prevent them from being shown to the user, you can do:
  CRM_Core_Session::getStatus(TRUE);
  
  > **Comments:**
  > **username_0**: you are my hero, thanks!!  For those, who've been asking for exact code example, here is it:       **(new CRM_Core_Session)->getStatus(TRUE);**  
  
  ---
  
  