title: How to display an alert from server script in Siebel?
body: <p>We have a Siebel 7.8 application, and a requirement to show a message when the user saves a record meeting certain conditions. Something like this:</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>function BusComp_WriteRecord () {
    if (conditions) {
      TheApplication().RaiseErrorText("Terribly important message");
    }
  }
  </code></pre>
  
  <p>The problem is that I can't use <code>RaiseErrorText</code> because it prevents further events execution. That leaves me with either <code>alert</code> or <code>SWEAlert</code> (unless there is another option which I don't know of).</p>
  
  <p>Both of them are supported only in browser scripts, and there is no browser version of the <code>BusComp_WriteRecord</code> event. All this means that I have to keep my validations in the server script event, and somehow invoke a browser script function which shows the message. The only way I've come up with is something like this:</p>
  
  <p><em>Server script (in the business component):</em></p>
  
  <pre class="lang-js prettyprint-override"><code>function BusComp_WriteRecord () {
    if (conditions) {
      TheApplication().SetProfileAttr("MyMessage", "Terribly important message");
    }
  }
  </code></pre>
  
  <p><em>Browser script (in an applet which is always loaded before the BC):</em></p>
  
  <pre class="lang-js prettyprint-override"><code>function Applet_Load () {
    listenerAlert();
  }
  
  function listenerAlert () {
    var message = TheApplication().GetProfileAttr("MyMessage");
    if ((message != null) &amp;&amp; (message != "")) {
      TheApplication().SetProfileAttr("MyMessage", "");
      alert(message);
    }
    // Keep checking for messages each 0,5 seconds, forever...
    setTimeout("listenerAlert()", 500);
  }
  </code></pre>
  
  <p>It does work, but it has an excessive impact on the servers performance. We have around 60 users per server, and apparently, checking a profile attribute twice a second for each user is too much (the CPU usage rises to 100%).</p>
  
  <p>So, is there any other way to show an alert to the user in Siebel 7.8? It has to be an alert or similar, i.e. Siebel broadcasting messages are not an option.</p>
  
  <p>Or, alternatively, if I have to stick with alert/SWEAlert: is there any other way to communicate between the server script and the browser script, without the endless polling?</p>