Add Personalized Response to Manual Notification

From SDU
Revision as of 14:35, 6 June 2008 by Gityerfix (Talk | contribs) (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...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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.

Note: This customization is only valid for r11.x releases.

Step 1. Edit the nr.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';

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

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); document.main_form.elements[resp_field].value+=unescape(msg); // Use to append field content // document.main_form.elements[resp_field].value=unescape(msg); // Use to replace field 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.



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.