<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Svetazk</id>
		<title>SDU - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://greggsmith.net/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Svetazk"/>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Special:Contributions/Svetazk"/>
		<updated>2026-07-27T11:34:06Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.26.1</generator>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2986</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2986"/>
				<updated>2008-08-08T17:48:14Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
&amp;lt;BR&amp;gt;1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
&amp;lt;BR&amp;gt;2. Location lookup &lt;br /&gt;
&amp;lt;BR&amp;gt;3. Phone lookup&lt;br /&gt;
&amp;lt;BR&amp;gt;So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== View the Complete Code ==&lt;br /&gt;
Coming soon&lt;br /&gt;
&lt;br /&gt;
== Customization Steps ==&lt;br /&gt;
=== Step 1. Add customer location and phone ===&lt;br /&gt;
Note that Ids are important here - they will be used by the callback functions to refresh the fields. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Step 2. Modify function backfill_cnt_event() as follows ===&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3. Add the following code at the end of backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Step 4. Add the following java script code before function backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2984</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2984"/>
				<updated>2008-08-08T17:34:01Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
&amp;lt;BR&amp;gt;1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
&amp;lt;BR&amp;gt;2. Location lookup &lt;br /&gt;
&amp;lt;BR&amp;gt;3. Phone lookup&lt;br /&gt;
&amp;lt;BR&amp;gt;So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
== Customization Steps ==&lt;br /&gt;
=== Step 1. Add customer location and phone ===&lt;br /&gt;
Note that Ids are important here - they will be used by the callback functions to refresh the fields. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Step 2. Modify function backfill_cnt_event() as follows ===&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3. Add the following code at the end of backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Step 4. Add the following java script code before function backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2983</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2983"/>
				<updated>2008-08-08T17:33:16Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
&amp;lt;BR&amp;gt;1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
&amp;lt;BR&amp;gt;2. Location lookup &lt;br /&gt;
&amp;lt;BR&amp;gt;3. Phone lookup&lt;br /&gt;
&amp;lt;BR&amp;gt;So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
== Customization Steps ==&lt;br /&gt;
=== Step 1. Add customer location and phone ===&lt;br /&gt;
Note that Ids are important here - they will be used by the callback functions to refresh the fields. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
=== Step 2. Modify function backfill_cnt_event() as follows ===&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3. Add the following code at the end of backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
=== Step 4. Add the following java script code before function backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2982</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2982"/>
				<updated>2008-08-08T17:32:22Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
&amp;lt;BR&amp;gt;1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
&amp;lt;BR&amp;gt;2. Location lookup &lt;br /&gt;
&amp;lt;BR&amp;gt;3. Phone lookup&lt;br /&gt;
&amp;lt;BR&amp;gt;So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
== Customization Steps ==&lt;br /&gt;
=== Step 1. Add customer location and phone ===&lt;br /&gt;
Note that Ids are important here - they will be used by the callback functions to refresh the fields. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
=== Step 2. Modify function backfill_cnt_event() as follows ===&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 3. Add the following code at the end of backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&amp;lt;/source&amp;quot;&amp;gt;&lt;br /&gt;
=== Step 4. Add the following java script code before function backfill_cnt_event() ===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2981</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2981"/>
				<updated>2008-08-08T17:24:27Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
2. Location lookup &lt;br /&gt;
3. Phone lookup&lt;br /&gt;
So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type ), where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
I will upload the complete code of detail_in.htmpl. If you can’t find it, feel free to email me and I will send it to you.&lt;br /&gt;
&lt;br /&gt;
Here are the customization steps.&lt;br /&gt;
&lt;br /&gt;
Step 1. Add customer location and phone. Note that Ids are important here - they will be used by the callback functions to refresh the fields.&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Modify function backfill_cnt_event() as follows.&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Step 3. Add the following code at the end of backfill_cnt_event():&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Step 4. Add the following java script code before function backfill_cnt_event().&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2980</id>
		<title>Refresh Customer Info Before Saving the Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Refresh_Customer_Info_Before_Saving_the_Ticket&amp;diff=2980"/>
				<updated>2008-08-08T17:22:03Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: New page: __NOTOC__ == Overview ==  This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE savi...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
== Overview == &lt;br /&gt;
This article provides customization to detail_in.htmpl for refreshing end user location and phone (as displayed on the form) when the end user changes BEFORE saving the change. The code works, but I am not crazy about it. I am hoping that someone can find a more elegant way to implement the same. I have only implemented and did limited testing in development, so the code has not been tested in the real world environment.&lt;br /&gt;
&lt;br /&gt;
My understanding of the code is very limited, and was gained by trial and error, so my explanation and terminology might not be correct.&lt;br /&gt;
&lt;br /&gt;
There are functions that you can use to call the server, I only mention two of them here: upd_workframe() and display_new_page(). In calls to these functions you can specify a callback function that will receive the results of the server lookup. In this code, I used two calls to display_new_page(): zCustomerLocationCallback() was specified as the callback in the 1st call, and zCustomerPhoneCallback() in the second one.&lt;br /&gt;
&lt;br /&gt;
I encountered a few problems. First, I could not find a way to look up both location and phone in one server call, even though they both would be a lookup of the same record based on the same contact UUID. As a result, I had to do two server calls. Another problem is that if you try to do one server call after another, only the callback that was evoked by the last one will be executed. In other words, if in backfill_cnt_event() I had the following code, I would only see the phone being refreshed:&lt;br /&gt;
upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerLocationCallback()&lt;br /&gt;
…..&lt;br /&gt;
display_new_page(url,ahdframeset.workframe); // with url for zCustomerPhoneCallback()&lt;br /&gt;
&lt;br /&gt;
That means that if you want to execute more than one callback per event, you have to call the next one from the previous. In this particular scenario, I had to execute 3 callback functions when an end user changes: &lt;br /&gt;
1. Service contract check (upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;..) - out of the box behavior)&lt;br /&gt;
2. Location lookup &lt;br /&gt;
3. Phone lookup&lt;br /&gt;
So I had to “chain” them: location callback function triggers phone callback, and phone callback triggers Service contract check. &lt;br /&gt;
&lt;br /&gt;
I based my code on nr_inv_tab.htmpl and nr_ops.js: this code causes the manufacturer to be refreshed when the model of the asset changes. zcustomerChanged() is based on ModelChanged(), and the 2 callback functions are based on modelChangedCallback(). The difference is that I could not use onBlur() or on Change(), because I needed contact UUID, not the combo name(there can be duplicates), and it wouldn’t be available there. That’s why I used function backfill_cnt_event( form_name, base_name, lname, fname, mname, cntID, caller_type ), where cntID is the new contact UUID. Also, I noticed that in nr_inv_tab.htmpl vendor only gets refreshed if the model is selected from the model search window, and not if you type it in and tab out. My code works in both scenarios. &lt;br /&gt;
&lt;br /&gt;
I will upload the complete code of detail_in.htmpl. If you can’t find it, feel free to email me and I will send it to you.&lt;br /&gt;
&lt;br /&gt;
Here are the customization steps.&lt;br /&gt;
&lt;br /&gt;
Step 1. Add customer location and phone. Note that Ids are important here - they will be used by the callback functions to refresh the fields.&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Location&amp;quot; attr=&amp;quot;customer.location&amp;quot; id=custloc&amp;gt;&lt;br /&gt;
&amp;lt;PDM_MACRO NAME=dtlReadonly hdr=&amp;quot;End User Phone&amp;quot; attr=&amp;quot;customer.phone_number&amp;quot; id=custphone&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Step 2. Modify function backfill_cnt_event() as follows.&lt;br /&gt;
Comment out (or delete) Contract enforcement code and add a call the new custom function. It will look as follows:&lt;br /&gt;
function backfill_cnt_event( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                             cntID, caller_type )&lt;br /&gt;
{&lt;br /&gt;
   if (_dtl.edit &amp;amp;&amp;amp; !_dtl.skip_agt_check)&lt;br /&gt;
   {&lt;br /&gt;
	var f = void(0);&lt;br /&gt;
	var r = form_name.match(/main_form([0-9]*)/);&lt;br /&gt;
	if ( r != null ) {&lt;br /&gt;
	    if ( r[1].length == 0 )&lt;br /&gt;
		f = _dtl.form[0];&lt;br /&gt;
	    else&lt;br /&gt;
		f = _dtl.form[r[1]-0];&lt;br /&gt;
	}&lt;br /&gt;
	detailAgtCheck(f, base_name, cntID, prop_ref);&lt;br /&gt;
   }&lt;br /&gt;
   detailCntBackfill( form_name, base_name, lname, fname, mname,&lt;br /&gt;
                      cntID, caller_type );&lt;br /&gt;
&lt;br /&gt;
    // sk: if user org has a service contract, the following code will clear out the category after changing user&lt;br /&gt;
    // if it is not a private category from the contract under the contract, and will display message: &lt;br /&gt;
    // &amp;quot;The current category can not be used with the current End User. The category has been reset.&amp;quot;&lt;br /&gt;
	// Contract enforcement:                  &lt;br /&gt;
/*&lt;br /&gt;
	if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes' &amp;amp;&amp;amp;&lt;br /&gt;
	base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1) {&lt;br /&gt;
        &lt;br /&gt;
        upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + cntID,&lt;br /&gt;
			  &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
*/&lt;br /&gt;
    // Note: even if remove &amp;quot;typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1&amp;quot;, zRefreshCustomerInfo() still does not get called&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Step 3. Add the following code at the end of backfill_cnt_event():&lt;br /&gt;
    if (base_name == &amp;quot;customer&amp;quot; &amp;amp;&amp;amp; typeof cntID != &amp;quot;undefined&amp;quot; &amp;amp;&amp;amp; cntID.length &amp;gt; 1)&lt;br /&gt;
   {&lt;br /&gt;
     zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type);&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
Step 4. Add the following java script code before function backfill_cnt_event().&lt;br /&gt;
var zcurrCustID=&amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
// Based on modelChanged() in nr_ops.js&lt;br /&gt;
function zcustomerChanged(form_name, base_name, lname, fname, mname, cntID, caller_type ) {&lt;br /&gt;
  //alert(cntID); //newly selected contact UUID&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var zcntID=cntID.replace(&amp;quot;U&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
  zcntID=zcntID.replace(&amp;quot;'&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
  if (zcurrCustID == zcntID) &lt;br /&gt;
    return;&lt;br /&gt;
  zcurrCustID=cntID;&lt;br /&gt;
&lt;br /&gt;
  var url;&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
  url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(zcntID)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=location.name&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerLocationCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerLocationCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  //alert(persid); // cnt UUID with &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(rel_attr_val); // cnt UUID without &amp;quot;cnt:&amp;quot; prefix&lt;br /&gt;
  //alert(value); // location name&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custloc&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  var zFID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;FID&amp;quot;].value;&lt;br /&gt;
  var zSID=document.forms[&amp;quot;main_form&amp;quot;].elements[&amp;quot;SID&amp;quot;].value;&lt;br /&gt;
  var url=cfgCgi+&amp;quot;?SID=&amp;quot;+zSID+&amp;quot;+FID=&amp;quot;+zFID&lt;br /&gt;
    +&amp;quot;+OP=SEARCH+FACTORY=cnt&amp;quot;&lt;br /&gt;
    +&amp;quot;+KEEP.domset_name=RLIST_STATIC&amp;quot;&lt;br /&gt;
    +&amp;quot;+QBE.EQ.id=&amp;quot;+escape(rel_attr_val)&lt;br /&gt;
    +&amp;quot;+KEEP.backfill_attr=phone_number&amp;quot;&lt;br /&gt;
    +&amp;quot;+HTMPL=javascript:parent.ahdframe.zCustomerPhoneCallback&amp;quot;;&lt;br /&gt;
  display_new_page(url,ahdframeset.workframe);&lt;br /&gt;
  if(ahdframe.currentAction==0) // =0 if customer selected from contact list; =6 if typed in &lt;br /&gt;
  {&lt;br /&gt;
    set_action_in_progress(ACTN_AUTOFILL);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Based on modelChangedCallback() in nr_ops.js&lt;br /&gt;
function zCustomerPhoneCallback(persid,value,rel_attr_val)&lt;br /&gt;
{&lt;br /&gt;
  set_action_in_progress(0);&lt;br /&gt;
  var e=document.getElementById(&amp;quot;custphone&amp;quot;);&lt;br /&gt;
  if(e!=null)&lt;br /&gt;
    e.innerHTML=value;&lt;br /&gt;
&lt;br /&gt;
  if (ahdtop.cfgNX_CLASSIC_SLA_PROCESSING != 'Yes') {        &lt;br /&gt;
     upd_workframe(&amp;quot;GET_SVC_CONTRACT&amp;quot;, &amp;quot;new_customer=cnt:&amp;quot; + rel_attr_val, &amp;quot;func=parent.ahdframe.get_svc_callback&amp;quot;);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Sample_Customizations&amp;diff=2979</id>
		<title>Sample Customizations</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Sample_Customizations&amp;diff=2979"/>
				<updated>2008-08-08T17:19:46Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* List of Customizations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
[[Category:Customization]]&lt;br /&gt;
{{Global Header}}&lt;br /&gt;
{{Global Announcement}}&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
Customizations are regarded as changes to the system that are not supportable by CA.&lt;br /&gt;
&lt;br /&gt;
== List of Customizations ==&lt;br /&gt;
*[[Add Attachments to Configuration Items]]&lt;br /&gt;
*[[Add Checkbox, Date, Drop-down, Lookup, Readonly and Text Fields to Properties]]&lt;br /&gt;
*[[Add Contact Search to Employee/Customer Interface]]&lt;br /&gt;
*[[Add Custom Activity Log Action Macro]]&lt;br /&gt;
*[[Add Log Entry for Updates to Custom Fields]]&lt;br /&gt;
*[[Add Log Entry When a Property Value Changes on a Ticket]]&lt;br /&gt;
*[[Add Personalized Response to Manual Notification]]&lt;br /&gt;
*[[Add Posted By to Announcements Page]]&lt;br /&gt;
*[[Add Properties Count to Area/Category List]]&lt;br /&gt;
*[[Add Workflow to Employee/Customer Interface]]&lt;br /&gt;
*[[Auto-fill Fields Left Blank]]&lt;br /&gt;
*[[Automatically Attach an Asset/CI to a Change Order or Issue]]&lt;br /&gt;
*[[Automatically Remove Attached Events]]&lt;br /&gt;
*[[Automatically Set Assignee to Closing Analyst]]&lt;br /&gt;
*[[Automatically Set System Generated Activities to Internal]]&lt;br /&gt;
*[[Changing Announcements Order By]]&lt;br /&gt;
*[[Changing Error Alert Color and adding Error Alert Pop-ups]]&lt;br /&gt;
*[[Changing Requests to Incidents]]&lt;br /&gt;
*[[Changing Display of Contacts]]&lt;br /&gt;
*[[Conditional Display of Drop-Down Content]]&lt;br /&gt;
*[[Conditionally Attach an Event]]&lt;br /&gt;
*[[Configure Java Client to Use Web Client for Uploading Attachments]]&lt;br /&gt;
*[[Control the Request Areas Displayed to the End Users]]&lt;br /&gt;
*[[Count Ticket Reopens]]&lt;br /&gt;
*[[Display Web Site within Service Desk]]&lt;br /&gt;
*[[Default Properties Tab on New Ticket Creation]]&lt;br /&gt;
*[[Increasing Default Field Size]]&lt;br /&gt;
*[[List Tickets ORDER BY Group]]&lt;br /&gt;
*[[Make a Field Conditionally Required]]&lt;br /&gt;
*[[Only Assignee can Close]]&lt;br /&gt;
*[[Prevent Close of Requests, Incidents, and Problems if Change Order is Active]]&lt;br /&gt;
*[[Prevent Update to Past Activities]]&lt;br /&gt;
*[[Propagate Status to Children]]&lt;br /&gt;
*[[Priority and Impact Default to Empty]]&lt;br /&gt;
*[[Refresh customer info before saving the ticket]]&lt;br /&gt;
*[[Remove SLA Violation from Employee View]]&lt;br /&gt;
*[[Require a Solution in Order to Resolve]]&lt;br /&gt;
*[[Search Requests, Incidents, and Problems Simultaneously for Ticket Number]]&lt;br /&gt;
*[[Separate Prefixes for Requests, Incidents, and Problems]]&lt;br /&gt;
*[[Set Defaults on Manual Notify]]&lt;br /&gt;
*[[Set Priority Based on Urgency and Impact]]&lt;br /&gt;
*[[Set Request, Incident and Problem Status from Change Order]]&lt;br /&gt;
*[[Simplified Child Creation]]&lt;br /&gt;
*[[Single Sign-on with Cookies]]&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1902</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1902"/>
				<updated>2008-05-13T19:14:32Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Add endDetail() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 2. Modify endDetail() in sitemods.js ==&lt;br /&gt;
&lt;br /&gt;
If you want to change the color of the error messages, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
e.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following under it:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;) e.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if(typeof e==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;e!=null){&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following code under it:&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;)  // prevent popup for success messages    &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',3);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 3. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified endDetail() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function endDetail()&lt;br /&gt;
{&lt;br /&gt;
  detailEndRow();&lt;br /&gt;
  var out=&amp;quot;&amp;quot;;&lt;br /&gt;
  if(_dtl.tableStarted)&lt;br /&gt;
    out=&amp;quot;&amp;lt;/TABLE&amp;gt;\n&amp;quot;;&lt;br /&gt;
  if(_dtl.formStarted)&lt;br /&gt;
    out+=&amp;quot;&amp;lt;/FORM&amp;gt;&amp;quot;;&lt;br /&gt;
  docWriteln(out);&lt;br /&gt;
  _dtl.tableStarted=false;&lt;br /&gt;
  if(typeof AlertMsg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;AlertMsg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    var e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
    if(typeof e==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;e!=null){&lt;br /&gt;
      // Popup alert with same text that is displayed in alertmsg area of the form&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;)      &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',3);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      e=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
      e.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // display alert in red&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;) &lt;br /&gt;
         e.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  if(typeof _dtl.firstField==&amp;quot;string&amp;quot;)&lt;br /&gt;
  {&lt;br /&gt;
    _dtl.firstField=document.getElementById(_dtl.firstField);&lt;br /&gt;
    if(_dtl.firstField!=null)&lt;br /&gt;
    {&lt;br /&gt;
      _dtl.onload=window.onload;&lt;br /&gt;
      window.onload=detailOnload;&lt;br /&gt;
    }&lt;br /&gt;
    else if(_dtl.edit)&lt;br /&gt;
     _dtl.form[0].style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  if(_dtl.center)&lt;br /&gt;
    docWriteln(&amp;quot;&amp;lt;/CENTER&amp;gt;&amp;quot;);&lt;br /&gt;
  if(typeof ahdtop==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;typeof ahdtop.detailForms==&amp;quot;object&amp;quot;&lt;br /&gt;
    &amp;amp;&amp;amp;(typeof alg_factory!=&amp;quot;string&amp;quot;||alg_factory==propFactory))&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof argPersistentID==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;argPersistentID.length&amp;gt;0)&lt;br /&gt;
      ahdtop.detailForms[argPersistentID]=window.parent;&lt;br /&gt;
    if(propFactory==&amp;quot;chg&amp;quot;&amp;amp;&amp;amp;typeof argChgRefNum==&amp;quot;string&amp;quot;)&lt;br /&gt;
      ahdtop.detailForms[&amp;quot;chg&amp;quot;+argChgRefNum]=window.parent;&lt;br /&gt;
    else if((propFactory==&amp;quot;cr&amp;quot;||propFactory==&amp;quot;iss&amp;quot;)&amp;amp;&amp;amp;typeof argRefNum==&amp;quot;string&amp;quot;)&lt;br /&gt;
      ahdtop.detailForms[propFactory+argRefNum]=window.parent;&lt;br /&gt;
  }&lt;br /&gt;
  if(_dtl.spellchk)&lt;br /&gt;
  {&lt;br /&gt;
    do_hiddenfm('spell_form','main_form');&lt;br /&gt;
  }&lt;br /&gt;
} // endDetail()&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1901</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1901"/>
				<updated>2008-05-13T19:11:30Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Add endDetail() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 2. Modify endDetail() in sitemods.js ==&lt;br /&gt;
&lt;br /&gt;
If you want to change the color of the error messages, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
e.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following under it:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;) e.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if(typeof e==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;e!=null){&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following code under it:&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;)  // prevent popup for success messages    &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',3);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 3. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1900</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1900"/>
				<updated>2008-05-13T19:09:47Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Add endDetail() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 2. Modify endDetail() in sitemods.js ==&lt;br /&gt;
&lt;br /&gt;
If you want to change the color of the error messages, find line &lt;br /&gt;
 &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;e.style.display=&amp;quot;block&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
 and add the following under it:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;) e.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if(typeof e==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;e!=null){&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following code under it:&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;)  // prevent popup for success messages    &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',3);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 3. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1899</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1899"/>
				<updated>2008-05-13T19:09:10Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 2. Modify endDetail() in sitemods.js ==&lt;br /&gt;
&lt;br /&gt;
If you want to change the color of the error messages, find line &lt;br /&gt;
 &amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;e.style.display=&amp;quot;block&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
 and add the following under it:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;) e.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, find line &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if(typeof e==&amp;quot;object&amp;quot;&amp;amp;&amp;amp;e!=null){&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and add the following code under it:&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
      if (AlertMsg.substr(0,15) != &amp;quot;Save Successful&amp;quot;)  // prevent popup for success messages    &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',3);&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 3. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1898</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1898"/>
				<updated>2008-05-13T18:50:13Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1897</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1897"/>
				<updated>2008-05-13T18:49:18Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function endDetail() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to endDetail() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to endDetail() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1896</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1896"/>
				<updated>2008-05-13T18:45:29Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part I. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part II. Alerts for data constraint and spell trigger validations =&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1895</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1895"/>
				<updated>2008-05-13T18:42:52Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I made modifications to a couple of java script functions to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
There are two different scenarios that lead to displaying of an alert message. If you want your color change to affect both scenarios, you will have to customize two Java script functions. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 1st scenario is triggered when an unconditionally required field (i.e. defined as required at the schema level) is not filled in. The function showAlertMsg() is called in this case, and that’s the one we need to modify. This scenario is covered by Part I of this article. &amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
The 2nd scenario is when either data partition constraints or SPL triggers enforce data validation. In this case, endDetail() is the function that needs to be modified. The details are provided in Part II of the article&amp;lt;BR&amp;gt;&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Part 1. Alerts for unconditionally required fields =&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1836</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1836"/>
				<updated>2008-04-04T20:03:16Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script function to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1835</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1835"/>
				<updated>2008-04-04T20:00:51Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&amp;lt;BR&amp;gt;&lt;br /&gt;
Note: Any patches/updates to showAlertMsg() in $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js must be manually ported to showAlertMsg() in $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1834</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1834"/>
				<updated>2008-04-04T19:58:20Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 2. Add showAlertMsg() function to sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy function showAlertMsg() from $NX_ROOT\bopcfg\www\wwwroot\scripts\detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1833</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1833"/>
				<updated>2008-04-04T19:54:42Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1832</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1832"/>
				<updated>2008-04-04T19:54:01Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1831</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1831"/>
				<updated>2008-04-04T19:53:00Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Clear your Web browser cache ==&lt;br /&gt;
Clear your Web browser cache to test (no need to recycle USD)&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1830</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1830"/>
				<updated>2008-04-04T19:51:39Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Modified code for showAlertMsg() */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modified showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1829</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1829"/>
				<updated>2008-04-04T19:51:10Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Modified code for showAlertMsg() ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1828</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1828"/>
				<updated>2008-04-04T19:49:29Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Modify showAlertMsg() in sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&amp;lt;BR&amp;gt;&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1827</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1827"/>
				<updated>2008-04-04T19:48:55Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Modify showAlertMsg() in sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
If you want to change the color of the error messages, add this line:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want error messages to be displayed in a pop-up, remove the condition that prevents pop-up for Analyst Interface.&lt;br /&gt;
Original code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg))&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Modified code:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1826</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1826"/>
				<updated>2008-04-04T19:44:14Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Modify showAlertMsg() in sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
Change alert background color&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1825</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1825"/>
				<updated>2008-04-04T19:40:43Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Modify showAlertMsg() in sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // Commented out the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      // Change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1824</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1824"/>
				<updated>2008-04-04T19:36:52Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Modify showAlertMsg() in sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      // sk: I commented our the original condition that prevents popups for analyst interface, and replaced it with a simplified one.&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      //sk: change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1823</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1823"/>
				<updated>2008-04-04T19:29:52Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
function showAlertMsg(msg,popup_alertmsg)&lt;br /&gt;
{&lt;br /&gt;
  e=document.getElementById(&amp;quot;alertmsgText&amp;quot;);&lt;br /&gt;
  if(e!=null&amp;amp;&amp;amp;typeof msg==&amp;quot;string&amp;quot;&amp;amp;&amp;amp;msg.length&amp;gt;0)&lt;br /&gt;
  {&lt;br /&gt;
    if(typeof AlertMsg!=&amp;quot;string&amp;quot;)&lt;br /&gt;
      AlertMsg=&amp;quot;&amp;quot;;&lt;br /&gt;
    if(AlertMsg.length&amp;gt;0)&lt;br /&gt;
      AlertMsg+=&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;+msg;&lt;br /&gt;
    else&lt;br /&gt;
      AlertMsg=msg;&lt;br /&gt;
     if(e.innerHTML!=AlertMsg)&lt;br /&gt;
    {&lt;br /&gt;
      e.innerHTML=AlertMsg;&lt;br /&gt;
      //if ((ahdtop.cstUsingScreenReader||ahdtop.cfgUserType!=&amp;quot;analyst&amp;quot;)&amp;amp;&amp;amp;(typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)) &lt;br /&gt;
      if (typeof popup_alertmsg!=&amp;quot;boolean&amp;quot;||popup_alertmsg)  &lt;br /&gt;
      {&lt;br /&gt;
        var popupMsg=AlertMsg.replace(RegExp(&amp;quot;&amp;lt;BR&amp;gt;&amp;quot;,&amp;quot;gi&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('\n',&amp;quot;g&amp;quot;),&amp;quot;\\n&amp;quot;)&lt;br /&gt;
        .replace(RegExp('&amp;quot;',&amp;quot;g&amp;quot;),'\\&amp;quot;');&lt;br /&gt;
        window.setTimeout('alert(&amp;quot;'+popupMsg+'&amp;quot;)',5);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
    var alertmsg=document.getElementById(&amp;quot;alertmsg&amp;quot;);&lt;br /&gt;
    if(alertmsg!=null&amp;amp;&amp;amp;alertmsg.style.display!=&amp;quot;block&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
      alertmsg.style.display=&amp;quot;block&amp;quot;;&lt;br /&gt;
      //@@@sk change color for the message within the page, in addition to the popup&lt;br /&gt;
      alertmsg.style.backgroundColor=&amp;quot;red&amp;quot;; &lt;br /&gt;
      adjScrollDivHeight();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1822</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1822"/>
				<updated>2008-04-04T19:21:22Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__ &lt;br /&gt;
This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity. This code will be used in the SPEL code when specifying log type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2. Create the spell file ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Request property&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification&lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change Order property&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification&lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Issue property&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;br /&gt;
The methods used to publish schema changes vary based on the Service Desk release.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;For r11.x releases&amp;lt;/font&amp;gt;, follow these steps:&lt;br /&gt;
#Save your Schema changes&lt;br /&gt;
#Stop the Service Desk service&lt;br /&gt;
#Run [[pdm_publish]] from a command line&lt;br /&gt;
#Start the Service Desk service&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;blue&amp;quot;&amp;gt;For older release&amp;lt;/font&amp;gt; recycle the Service Desk service.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1821</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1821"/>
				<updated>2008-04-04T19:17:18Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &amp;lt;BR&amp;gt;&lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&amp;lt;BR&amp;gt;&lt;br /&gt;
I modified a java script file to change this behavior. &amp;lt;BR&amp;gt;&lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&amp;lt;BR&amp;gt;&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&amp;lt;BR&amp;gt;&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1820</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1820"/>
				<updated>2008-04-04T19:15:51Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Changing Error Alert Color and adding Error Alert Pop-ups&lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. &lt;br /&gt;
We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&lt;br /&gt;
I modified a java script file to change this behavior. &lt;br /&gt;
Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to.&lt;br /&gt;
Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1819</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1819"/>
				<updated>2008-04-04T19:14:23Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 1. Create sitemods.js */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Changing Error Alert Color and adding Error Alert Pop-ups&lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&lt;br /&gt;
I modified a java script file to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to. Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Add showAlertMsg() function to sitemods.js ==&lt;br /&gt;
Copy code for function showAlertMsg() from detail_form.js and paste it into $NX_ROOT\site\mods\www\wwwroot\scripts\sitemods.js&lt;br /&gt;
&lt;br /&gt;
== Step 3. Modify showAlertMsg() in sitemods.js ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1818</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1818"/>
				<updated>2008-04-04T19:10:34Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Changing Error Alert Color and adding Error Alert Pop-ups&lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&lt;br /&gt;
I modified a java script file to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to. Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&lt;br /&gt;
Here is what needs to be done.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create sitemods.js ==&lt;br /&gt;
If you don’t have sitemods.js in $NX_ROOT\site\mods\www\wwwroot\scripts, copy it from $NX_ROOT\bopcfg\www\wwwroot\scripts.&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1817</id>
		<title>Changing Error Alert Color and adding Error Alert Pop-ups</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Changing_Error_Alert_Color_and_adding_Error_Alert_Pop-ups&amp;diff=1817"/>
				<updated>2008-04-04T19:06:39Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: New page: Changing Error Alert Color and adding Error Alert Pop-ups Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successf...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Changing Error Alert Color and adding Error Alert Pop-ups&lt;br /&gt;
Our analysts complained that they were loosing tickets because USD displayed error messages in the same color, yellow, as successful save messages. The analysts would miss the error message and the click “Close Window” button thinking that the ticket was created. We had an issue open with CA, and their advice was to change BACKGROUND-COLOR for alertmsg class in styles_ahd.css. Of course, that would not do us any good, because it would apply to successful save messages as well.&lt;br /&gt;
I modified a java script file to change this behavior. Originally I did two things: made the color of the error messages red, and in addition to that, displayed the same error message in a pop-up. In the end we decided that red was too much, since we now have the pop-up. But at least we know how to change the color, if we want to. Please note that this change will affect all detail forms in all interfaces in USD, not only tickets for analysts.&lt;br /&gt;
Here is what needs to be done.&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Sample_Customizations&amp;diff=1816</id>
		<title>Sample Customizations</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Sample_Customizations&amp;diff=1816"/>
				<updated>2008-04-04T19:04:01Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Customization]]&lt;br /&gt;
Customizations are regarded as changes to the system that are not supportable by CA.&lt;br /&gt;
== List of Customizations ==&lt;br /&gt;
&lt;br /&gt;
*[[Add Checkbox, Date, Drop-down, Lookup, Readonly and Text Fields to Properties]]&lt;br /&gt;
*[[Add Custom Activity Log Action Macro]]&lt;br /&gt;
*[[Add Log Entry for Updates to Custom Fields]]&lt;br /&gt;
*[[Add Log Entry When a Property Value Changes on a Ticket]]&lt;br /&gt;
*[[Add Posted By to Announcements Page]]&lt;br /&gt;
*[[Auto-fill Fields Left Blank]]&lt;br /&gt;
*[[Automatically Attach an Asset/CI to a Change Order or Issue]]&lt;br /&gt;
*[[Automatically Remove Attached Events]]&lt;br /&gt;
*[[Automatically Set Assignee to Closing Analyst]]&lt;br /&gt;
*[[Automatically Set System Generated Activities to Internal]]&lt;br /&gt;
*[[Changing Error Alert Color and adding Error Alert Pop-ups]]&lt;br /&gt;
*[[Changing Requests to Incidents]]&lt;br /&gt;
*[[Conditional Display of Drop-Down Content]]&lt;br /&gt;
*[[Conditionally Attach an Event]]&lt;br /&gt;
*[[Configure Java Client to Use Web Client for Uploading Attachments]]&lt;br /&gt;
*[[Control the Request Areas Displayed to the End Users]]&lt;br /&gt;
*[[Count Ticket Reopens]]&lt;br /&gt;
*[[Increasing Default Field Size]]&lt;br /&gt;
*[[List Tickets ORDER BY Group]]&lt;br /&gt;
*[[Make a Field Conditionally Required]]&lt;br /&gt;
*[[Only Assignee can Close]]&lt;br /&gt;
*[[Prevent Close of Requests, Incidents, and Problems if Change Order is Active]]&lt;br /&gt;
*[[Prevent Update to Past Activities]]&lt;br /&gt;
*[[Priority and Impact Default to Empty]]&lt;br /&gt;
*[[Remove SLA Violation from Employee View]]&lt;br /&gt;
*[[Separate Prefixes for Requests, Incidents, and Problems]]&lt;br /&gt;
*[[Set Defaults on Manual Notify]]&lt;br /&gt;
*[[Simplified Child Creation]]&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;div align='center'&amp;gt;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;To make corrections or additions to this article, select the ''edit'' tab above.&amp;lt;br&amp;gt;&lt;br /&gt;
To discuss or ask questions about this article, select the ''discussion'' tab above.&amp;lt;/font&amp;gt;&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1773</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1773"/>
				<updated>2008-03-28T20:32:03Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity. This code will be used in the SPEL code when specifying log type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2. Create the spell file ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Request property&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification&lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change Order property&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification&lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Issue property&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1772</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1772"/>
				<updated>2008-03-28T20:31:15Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 2. Create the spell file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity. This code will be used in the SPEL code when specifying log type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2. Create the spell file ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Request property&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; // Code that identifies &amp;quot;Property Update&amp;quot; Activity Notification&lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change Order property&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Issue property&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1771</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1771"/>
				<updated>2008-03-28T20:29:49Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 1. Create the Activity Notification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity. This code will be used in the SPEL code when specifying log type:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 2. Create the spell file ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Request property&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change Order property&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Issue property&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1770</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1770"/>
				<updated>2008-03-28T20:23:17Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 2. Create the spell file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Create the spell file ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Request property&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Change Order property&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Issue property&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1769</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1769"/>
				<updated>2008-03-28T20:19:21Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 2. Create the spell file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
//  Dummy function, just so RCS Id is embedded in compiled spell file...&lt;br /&gt;
string prp_log_spl_RCSID() { return &amp;quot;@(#)$Id: prp_log.spl,v 1.00 2007/21/0 21:54:25 lauke01 Exp $&amp;quot;; }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Trigger for request property: (cr_prp): POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
cr_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;cr_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, cr_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
cr_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;cr&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, cr_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object alg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;alg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new alg for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
alg = msg[0]; &lt;br /&gt;
alg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
alg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
alg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
alg.call_req_id = cr_persid; &lt;br /&gt;
alg.analyst = log_agt;&lt;br /&gt;
alg.system_time = (int)now();&lt;br /&gt;
alg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for cr=%s property=%s: %s&amp;quot;, ME, cr_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Trigger for Change Order property: (prp): POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, chg_id, chg_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
chg_id = argv[6];&lt;br /&gt;
chg_persid = format(&amp;quot;chg:%s&amp;quot;,chg_id);&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
// wrong syntax below&lt;br /&gt;
//send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_id&amp;quot;, 0, chg_id); &lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chg&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, chg_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) { &lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object chgalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;chgalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new chgalg for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
chgalg = msg[0]; &lt;br /&gt;
chgalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
chgalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
chgalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
chgalg.change_id = chg_id; &lt;br /&gt;
chgalg.analyst = log_agt;&lt;br /&gt;
chgalg.system_time = (int)now();&lt;br /&gt;
chgalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for chg=%s property=%s: %s&amp;quot;, ME, chg_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
// Trigger for issue property: (iss_prp): POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
iss_prp::zlog_value_change(...)&lt;br /&gt;
{&lt;br /&gt;
string ME; &lt;br /&gt;
ME = &amp;quot;iss_prp::zlog_value_change&amp;quot;; &lt;br /&gt;
&lt;br /&gt;
string prp_persid, iss_persid, old_val, new_val, zzlabel, zzsequence;&lt;br /&gt;
&lt;br /&gt;
prp_persid = argv[3];&lt;br /&gt;
iss_persid = argv[6];&lt;br /&gt;
old_val = argv[8];&lt;br /&gt;
new_val = argv[9];&lt;br /&gt;
zzlabel = argv[12];&lt;br /&gt;
zzsequence = argv[15];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;iss&amp;quot;, &amp;quot;dob_by_persid&amp;quot;, 0, iss_persid);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get dob for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return;&lt;br /&gt;
} &lt;br /&gt;
object dob; &lt;br /&gt;
dob = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, top_object(), &amp;quot;get_co_group&amp;quot;);&lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get group leader for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
object group_leader;&lt;br /&gt;
group_leader = msg[0];&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkout&amp;quot;, dob); &lt;br /&gt;
if (msg_error() &amp;amp;&amp;amp; msg[0] != &amp;quot;NO&amp;quot;) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkout failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
send_wait(0, dob, &amp;quot;call_attr&amp;quot;, &amp;quot;log_agent&amp;quot;, &amp;quot;get_val&amp;quot;); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get log agent for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
uuid log_agt;&lt;br /&gt;
log_agt = msg[0];&lt;br /&gt;
&lt;br /&gt;
object issalg;&lt;br /&gt;
send_wait( 0, top_object(), &amp;quot;call_attr&amp;quot;, &amp;quot;issalg&amp;quot;, &amp;quot;get_new_dob&amp;quot;, NULL, NULL, group_leader); &lt;br /&gt;
if (msg_error()) { &lt;br /&gt;
  logf (ERROR, &amp;quot;%s: could not get new issalg for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]); &lt;br /&gt;
  return; &lt;br /&gt;
} &lt;br /&gt;
&lt;br /&gt;
issalg = msg[0]; &lt;br /&gt;
issalg.type = &amp;quot;PROP&amp;quot;; &lt;br /&gt;
issalg.description = format(&amp;quot;FIELD='property' LABEL='%s' SEQUENCE='%s' OLD='%s' NEW='%s'&amp;quot;, zzlabel,zzsequence,old_val,new_val);&lt;br /&gt;
issalg.time_spent = &amp;quot;00:00:00&amp;quot;; &lt;br /&gt;
issalg.issue_id = iss_persid; &lt;br /&gt;
issalg.analyst = log_agt;&lt;br /&gt;
issalg.system_time = (int)now();&lt;br /&gt;
issalg.last_mod_dt = (int)now();&lt;br /&gt;
&lt;br /&gt;
send_wait(0, group_leader, &amp;quot;checkin&amp;quot;);&lt;br /&gt;
if (msg_error()) {&lt;br /&gt;
  logf(ERROR, &amp;quot;%s: checkin failed for iss=%s property=%s: %s&amp;quot;, ME, iss_persid, zzsequence, msg[0]);&lt;br /&gt;
  send_wait(0, group_leader, &amp;quot;uncheck&amp;quot;);&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1768</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1768"/>
				<updated>2008-03-28T20:14:07Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1767</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1767"/>
				<updated>2008-03-28T20:13:27Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 2. Write the spell code */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
Create a spel file prop_log.spl in $NX_ROOT\site\mods\majic folder.&lt;br /&gt;
   Note: if you change the name of the spel file, change the name of the dummy function in the beginning of the spel file accordingly&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1766</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1766"/>
				<updated>2008-03-28T20:11:21Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Add the triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1765</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1765"/>
				<updated>2008-03-28T20:10:38Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Add the triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1764</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1764"/>
				<updated>2008-03-28T20:09:32Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
 POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;text&amp;quot;&amp;gt;POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1763</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1763"/>
				<updated>2008-03-28T20:05:08Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Add the triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
 POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property):&lt;br /&gt;
POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property):&lt;br /&gt;
POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1762</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1762"/>
				<updated>2008-03-28T20:03:36Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: /* Step 3. Add the triggers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
Using Schema Designer tool in Web Screen Painter, add the following site-defined triggers:&lt;br /&gt;
&lt;br /&gt;
Table cr_prp (request property):&lt;br /&gt;
 POST_CI zlog_value_change(persistent_id,owning_cr,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
Table iss_prp (issue property)&lt;br /&gt;
POST_CI zlog_value_change(persistent_id,owning_iss,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
Table prpr (change property)&lt;br /&gt;
POST_CI zlog_value_change(persistent_id,object_id,value,label,sequence) 1050 FILTER(EVENT(&amp;quot;UPDATE&amp;quot;) &amp;amp;&amp;amp; value {} );&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1761</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1761"/>
				<updated>2008-03-28T19:56:11Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]], adding [[Site-Defined Trigger|Site-Defined Triggers]], and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
Create a new Activity Notification, “Property Update” in USD Web Client. &lt;br /&gt;
It can be done by copying an existing Activity Notification, &amp;quot;Field Update&amp;quot; via File | Copy menu option.&lt;br /&gt;
Use the code &amp;quot;PROP&amp;quot; for the new activity.&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	<entry>
		<id>http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1759</id>
		<title>Add Log Entry When a Property Value Changes on a Ticket</title>
		<link rel="alternate" type="text/html" href="http://greggsmith.net/wiki/index.php?title=Add_Log_Entry_When_a_Property_Value_Changes_on_a_Ticket&amp;diff=1759"/>
				<updated>2008-03-27T15:35:45Z</updated>
		
		<summary type="html">&lt;p&gt;Svetazk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article provides instructions for adding entries to the [[Activity Log]] when a property value changes on a ticket.&lt;br /&gt;
The steps involved are creating a new [[Activity Notification]] , adding [[Site-Defined Trigger|Site-Defined Triggers]] , and writing SPEL code for functions used by the the triggers.&lt;br /&gt;
&lt;br /&gt;
== Step 1. Create the Activity Notification ==&lt;br /&gt;
&lt;br /&gt;
== Step 2. Write the spell code ==&lt;br /&gt;
&lt;br /&gt;
== Step 3. Add the triggers ==&lt;br /&gt;
&lt;br /&gt;
== Step 4. Publish the Schema changes ==&lt;/div&gt;</summary>
		<author><name>Svetazk</name></author>	</entry>

	</feed>