TMACUL

http://www.servicedeskusers.com/Add_Contact_Search_to_Employee/Customer_Interface

Blog Post created by TMACUL Champion on Jan 21, 2016

Overview

This article provides instructions for adding Contact Searching capabilities to the Employee/Customer Interface.

Procedures

Step 1. Remove Data Partition Constraints

By default the Employee and Customer Access Types have Data Partitions associated with them. Delete or Inactivate the VIEW constraint on the ca_contact table.

Step 2. Add lookup field to forms

Add a dtlLookup PDM_MACRO to the desired detail form (detail_chg.htmpl, detail_cr.htmpl, detail_iss.htmpl). When the label of this field is selected the list_cnt.htmpl form is launched. Example:

<PDM_MACRO NAME=dtlLookup hdr="My Field" attr="zyourfield"> 

Step 3. Create list_cnt.htmpl Form

The list_cnt.htmpl will display the list of contacts from which to make a selection.

Click Here to download file, or copy syntax below.


<html
lang="en">
<
HEAD>

<PDM_PRAGMA RELEASE=110>
<PDM_INCLUDE FILE="std_head.htmpl">
<pdm_set PRE.Is3FieldContact=1>
<SCRIPT> var argBackfillField = '$args.KEEP.backfill_field';
var argBackfillForm = '$args.KEEP.backfill_form';
var argBackfillAttr = '$args.KEEP.backfill_attr';  
<PDM_IF "${current:n/a}" == "n/a">
searchFilterInitialState = "show";
<PDM_ELSE>
var cfgCurrent = '$current';
var cfgTotal = '$total';
var cfgRecordCount = '$record_count';
var cfgStart = '$start'; var cfgLength = '$length';
</PDM_IF>

var cfgIsPopup = '$args.KEEP.IsPopUp';
var rptName = new Array("no", "no");
var cfgCanEdit = true;
</SCRIPT>


<PDM_INCLUDE FILE=std_list_include.htmpl>
<SCRIPT LANGUAGE="JavaScript" SRC="$CAisd/scripts/sitemods.js"></SCRIPT>
</HEAD> <BODY CLASS="list"> <PDM_INCLUDE FILE=std_body.htmpl>  
<SCRIPT LANGUAGE="JavaScript"> <pdm_macro name=sfStart factory=cnt>  
<pdm_macro name=sfStartRow>
<pdm_macro name=sfTextbox hdr="Last Name" attr=last_name size=20>
<pdm_macro name=sfTextbox hdr="First Name" attr=first_name size=20>
<pdm_macro name=sfTextbox hdr="Middle Name" attr=middle_name size=20> 
<pdm_macro name=sfStartRow>
<pdm_macro name=sfDropdown hdr="Active" attr=delete_flag>
<pdm_macro name=sfTextbox hdr="Contact ID" attr=contact_num size=20>
<pdm_macro name=sfTextbox hdr="Phone Number" attr=phone_number size=20>  
<pdm_macro name=sfEnd> </SCRIPT> <PDM_FORM NAME="frmFID">
</PDM_FORM>
<PDM_IF "${current:n/a}" != "n/a"> <
SCRIPT
LANGUAGE="JavaScript">

var msgFoundNone = "No contacts found";
var msgFound1 = "1 contact found";
var msgFound = "%1 contcts found";
var msgFoundMore = "%1 contacts found. 
Displaying %2 through %3";
var msgSelect = "Click to select desired contact";  
<pdm_macro name=lsStart>

<pdm_macro name=lsCol hdr="Name" attr=combo_name link=yes>
<pdm_macro name=lsCol hdr="Phone Number" attr=phone_number>
<pdm_macro name=lsCol hdr="Location" attr=location.name>
<pdm_macro name=lsCol hdr="Organization" attr=organization.name>
<pdm_macro name=lsCol hdr="Status" attr=delete_flag> <pdm_macro name=lsEnd>
</SCRIPT>
</PDM_IF>
<BASE TARGET="_top">

<PDM_INCLUDE FILE="std_footer.htmpl">

</BODY> </HTML>

Step 4. Clear the web cache

The final step is to clear Service Desk's cache. Publish your changes via the Web Screen Painter. The process of publishing automatically initiates a pdm_webcache.

Outcomes