Difference between revisions of "Add Personalized Response to Manual Notification"

From SDU
Jump to: navigation, search
m (New page: This article provides instructions on how to add Personalized Responses to a Manual Notification. Surprisingly, Manual Notifications are one Activity that does not utilize Personalized...)
 
m (Reverted edits by Agegeleruvy (Talk); changed back to last version by Gityerfix)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This article provides instructions on how to add [[Personalized Responses]] to a Manual Notification. Surprisingly, Manual Notifications are one Activity that does not utilize Personalized Responses. The code that follows provides an option for appending the field content (which is the standard systemwide behavior) or replacing the field content.
+
__NOTOC__
 +
[[Category:Change Orders]]
 +
[[Category:Customizations]]
 +
[[Category:Incidents]]
 +
[[Category:Issues]]
 +
[[Category:Problems]]
 +
[[Category:r11]]
 +
[[Category:r12]]
 +
[[Category:Requests]]
 +
{{Global Header}}
 +
{{Global Announcement}}
  
Note: This customization is only valid for r11.x releases.
+
== Overview ==
 +
This article provides instructions on how to add [[Personalized Responses]] to a [[Manual Notification.]] Surprisingly, Manual Notifications are one Activity that does not utilize Personalized Responses. The code that follows provides an option for appending the field content (which is the standard system-wide behavior) or replacing the field content.
  
== Step 1. Edit the nr.htmpl form ==
+
== Procedures ==
 +
=== Step 1. Edit the nf.htmpl form ===
 
Add the following code to the HEAD of the form:
 
Add the following code to the HEAD of the form:
 
<source lang="javascript"><SCRIPT LANGUAGE="JavaScript">
 
<source lang="javascript"><SCRIPT LANGUAGE="JavaScript">
Line 12: Line 24:
 
resp_field="KEEP.msgtxt";
 
resp_field="KEEP.msgtxt";
 
resp_persid='$args.persistent_id';
 
resp_persid='$args.persistent_id';
 +
resp_title="KEEP.msgtitle";
  
<PDM_IF "$args.type" == "R" || "$args.type" == "">  
+
<PDM_IF "$prop.factory" == "chg">
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1">
+
var title_strg = "Change order $args.chg_ref_num Manual Notify";
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
+
<PDM_ELIF "$prop.factory" == "iss">
resp_ids[resp_ids.length] = '$list.id';
+
var title_strg = "Issue $args.ref_num Manual Notify";
</PDM_LIST>
+
<PDM_ELSE>
<PDM_ELIF "$args.type" == "I">
+
<PDM_IF "$env.NX_OTB_MARKET" == "itil">
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1">
+
var title_strg = "$args.type.sym $args.ref_num Manual Notify";
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
+
<PDM_ELSE>
resp_ids[resp_ids.length] = '$list.id';
+
var title_strg = "Request $args.ref_num Manual Notify";
</PDM_LIST>
+
</PDM_IF>
<PDM_ELIF "$args.type" == "P">
+
</PDM_IF>
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1">
+
 
 +
<PDM_IF "$prop.factory" == "chg">
 +
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND chg_flag=1">
 
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
 
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
 
resp_ids[resp_ids.length] = '$list.id';
 
resp_ids[resp_ids.length] = '$list.id';
 
</PDM_LIST>
 
</PDM_LIST>
 +
<PDM_ELSE>
 +
<PDM_IF "$args.type" == "R" || "$args.type" == "">
 +
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1">
 +
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
 +
resp_ids[resp_ids.length] = '$list.id';
 +
</PDM_LIST>
 +
<PDM_ELIF "$args.type" == "I">
 +
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1">
 +
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
 +
resp_ids[resp_ids.length] = '$list.id';
 +
</PDM_LIST>
 +
<PDM_ELIF "$args.type" == "P">
 +
<PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1">
 +
resp_sym[resp_sym.length] = decodeURIComponent('$list.sym');
 +
resp_ids[resp_ids.length] = '$list.id';
 +
</PDM_LIST>
 +
</PDM_IF>
 
</PDM_IF>
 
</PDM_IF>
  
Line 42: Line 74:
 
}
 
}
 
}
 
}
 +
 
function add_response_callback_nf(msg){
 
function add_response_callback_nf(msg){
 
set_action_in_progress(0);
 
set_action_in_progress(0);
document.main_form.elements[resp_field].value+=unescape(msg); // Use to append field content
+
if (document.main_form.elements["KEEP.msgtxt"].value == "") {
// document.main_form.elements[resp_field].value=unescape(msg); // Use to replace field content
+
document.main_form.elements[resp_title].value=unescape(title_strg);
 +
}
 +
document.main_form.elements[resp_field].value+=unescape(msg); // Use to append Message Text content
 +
// document.main_form.elements[resp_field].value=unescape(msg); // Use to replace Message Text content
 
}
 
}
 
</SCRIPT></source>
 
</SCRIPT></source>
 
  
 
Add the following code to the BODY of the form:
 
Add the following code to the BODY of the form:
Line 68: Line 103:
 
</source>
 
</source>
  
 
+
=== Step 2. Clear the web cache ===
== Step 2. Clear the web cache ==
+
 
Publish your changes via the [[Web Screen Painter]]. The process of publishing automatically initiates a [[pdm_webcache]].
 
Publish your changes via the [[Web Screen Painter]]. The process of publishing automatically initiates a [[pdm_webcache]].
 
 
----
 
<div align='center'><font color="red">To make corrections or additions to this article, select the ''edit'' tab above.<br>
 
To discuss or ask questions about this article, select the ''discussion'' tab above.</font></div>
 
 
[[Category:Customizations]]
 

Latest revision as of 05:41, 24 November 2010

To make corrections or additions to this article, select the edit tab above.
To discuss or ask questions about this article, select the discussion tab above.

Overview

This article provides instructions on how to add Personalized Responses to a Manual Notification. Surprisingly, Manual Notifications are one Activity that does not utilize Personalized Responses. The code that follows provides an option for appending the field content (which is the standard system-wide behavior) or replacing the field content.

Procedures

Step 1. Edit the nf.htmpl form

Add the following code to the HEAD of the form: <source lang="javascript"><SCRIPT LANGUAGE="JavaScript"> var resp_sym = new Array(); var resp_ids = new Array(); resp_sym[0] = ""; resp_ids[0] = ""; resp_field="KEEP.msgtxt"; resp_persid='$args.persistent_id'; resp_title="KEEP.msgtitle";

<PDM_IF "$prop.factory" == "chg"> var title_strg = "Change order $args.chg_ref_num Manual Notify"; <PDM_ELIF "$prop.factory" == "iss"> var title_strg = "Issue $args.ref_num Manual Notify"; <PDM_ELSE> <PDM_IF "$env.NX_OTB_MARKET" == "itil"> var title_strg = "$args.type.sym $args.ref_num Manual Notify"; <PDM_ELSE> var title_strg = "Request $args.ref_num Manual Notify"; </PDM_IF> </PDM_IF>

<PDM_IF "$prop.factory" == "chg"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND chg_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELSE> <PDM_IF "$args.type" == "R" || "$args.type" == ""> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND cr_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELIF "$args.type" == "I"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND in_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> <PDM_ELIF "$args.type" == "P"> <PDM_LIST ESC_STYLE=JS2 prefix=list factory=response where="delete_flag=0 AND (response_owner IS NULL or response_owner = U'$cst.id') AND pr_flag=1"> resp_sym[resp_sym.length] = decodeURIComponent('$list.sym'); resp_ids[resp_ids.length] = '$list.id'; </PDM_LIST> </PDM_IF> </PDM_IF>

function add_response_nf(i) { if(ahdframe.currentAction==0&&i>0) { var url=cfgCgi+"?SID="+cfgSID+"+FID="+fid_generator()+ "+OP=PERSRESP_EXPAND+MSG_ID="+resp_ids[i]+ "+PERSID="+resp_persid+ "+CALLBACK=parent.ahdframe.add_response_callback_nf"; display_new_page(url,ahdframeset.workframe); set_action_in_progress(ACTN_AUTOFILL); } }

function add_response_callback_nf(msg){ set_action_in_progress(0); if (document.main_form.elements["KEEP.msgtxt"].value == "") {

document.main_form.elements[resp_title].value=unescape(title_strg);

} document.main_form.elements[resp_field].value+=unescape(msg); // Use to append Message Text content // document.main_form.elements[resp_field].value=unescape(msg); // Use to replace Message Text content } </SCRIPT></source>

Add the following code to the BODY of the form: <source lang="javascript"> if (resp_ids.length > 1) { <PDM_MACRO NAME=dtlStartRow> detailRowHdr("Personalized Response",1,0); docWriteln('<TR><TD ALIGN=LEFT>'); _dtl.eventHandler = 'onBlur="add_response_nf(selectedIndex)"'; docWriteln('<SELECT' + detailNextID(true) + '>'); for (i = 0; i < resp_ids.length; i++) { docWrite('<OPTION VALUE="' + resp_ids[i] + '" '); docWriteln('>' + resp_sym[i] +'</OPTION>'); } docWriteln('</SELECT></TD></TR>'); } </source>

Step 2. Clear the web cache

Publish your changes via the Web Screen Painter. The process of publishing automatically initiates a pdm_webcache.