title: Suppress/clear messages in oracle forms 10g
body: <p>I have some validation code that, when a user tries to save, will run through some complex business rules and determine if the current data entered matches the rules enough so to allow a save.  If not, an error message telling them what rule is in violation is put at the bottom of the screen using <code>message('All foos of type bar must qux.')</code>.</p>
  
  <p>When they exit the form, it also runs against validation, and if successful, asks them if they want to save (using the built in question).  If not successful, I have an alert that informs them all data will be lost and asks if they still wish to exit.  The trouble is, when they click 'Exit Anyway', the validation message pops up.  Once they click ok, the form closes as expected.</p>
  
  <p>I'm attempting to suppress/clear messages so that this popup doesn't happen.  I've tried changing the message level but it still pops up.  I've tried sticking in a <code>message('', NO_ACKNOWLEDGE)</code> but that only lets me control where in my if/else chains I want the message to popup.</p>
  
  <p>Is there some <code>clear_messages</code> or such I can do to just cancel all messages on the form waiting to be displayed?</p>
  
  <p>As it currently stands, if I do</p>
  
  <pre><code>message('something')
  </code></pre>
  
  <p>I get a message in the status bar.</p>
  
  <p>If I do</p>
  
  <pre><code>message('something')
  message('something else')
  </code></pre>
  
  <p>the second one is in the message bar while the first one pop ups on the screen.</p>
  
  <p>I am asking if there was a way to keep the first message from popping up.  This is clearly something being done in oracle forms, and I've already explained a few attempts to clear it.  Yes, I don't understand how to clear the status bar to keep the message from popping up, which is the whole reason I asked the question.</p>
  
  <p>Perhaps I need to note why</p>
  
  <pre><code>message('something', no_acknowledge);
  message('something else');
  </code></pre>
  
  <p>does not solve my problem?</p>
  
  <p>If that is the case, the reason is because the first message is being printed out by a program unit where in all cases except this one, I want it to popup if another message comes in.</p>
  
  <p>In other words, I have</p>
  
  <pre><code>function do_something return number is
    ...
  begin
    ...
    message('something');
    ...
  end;
  </code></pre>
  
  <p>where do_something handles running against some business rules.</p>
  
  <p>Elsewhere, in the key-exit trigger I have</p>
  
  <pre><code>...
  if do_something = 0 then
    if Show_Alert('Alert_that_explains_data_is_not_being_saved_due_to_validation_failure') = alert_button 1 then
      exit_form(no_validate);
    end if;
  else
    exit_form;
  end if;
  ...
  </code></pre>
  
  <p>and in every other case except this one, when I call do_something, I want the message to pop up when another message is put on the status bar, but in this one case, I don't want it to be.  As such, I'm asking if there is a way to clear the message or suppress it so that it doesn't pop up in this case.</p>