TMACUL

ttp://www.servicedeskusers.com/Add_Personalized_Response_to_Manual_Notification

Blog Post created by TMACUL Champion on Jan 1, 2016

Add Personalized Response to Manual Notification

 

From SDU

Jump to: navigation, search

 

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:

<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>

 

Add the following code to the BODY of the form:

 

 

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>');

 

tep 2. Clear the web cache

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

Retrieved from "http://www.servicedeskusers.com/Add_Personalized_Response_to_Manual_Notification"

 

 

Outcomes