Subentity Lookup

Root > 3. Customisation

Simply replace any lookup.html file with this code and the correct subentitiy tables will pull through.

This works because the relationship between the Subentity table and the lookupwhatever.html is set within the table defaults on a per table basis. This enhancement makes it easier to role out new tables and integrations without excessive coding locally.

User will need to select their personal preferences in regard to which fields are displayed then they are set to go.


<html>
<head>
<#dbparams mainpage=<#editpage>>
<#WCETAGS>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>WiredContact Enterprise</title>
<link type="text/css" href="css/<#StyleSheet>" rel="stylesheet">
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<#jscript>
</head>

<body bgcolor="#EFEEEA" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"
   onLoad="MM_preloadImages('images/my_contacts_over.gif','images/my_contacts_down.gif','images/my_record_over.gif',
   'images/my_record_down.gif','images/recent_contacts_over.gif','images/recent_contacts_down.gif','images/print_over.gif',
   'images/print_down.gif','images/lookup_now_button_over.gif')">
<#form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#999999">
    <td align="left" valign="top"><img src="images/lookup_title.jpg" width="140" height="54"></td>
    <td align="right" valign="top"><img src="images/lookup_banner.jpg" width="664" height="54"></td>
  </tr>
</table>

<#noprint>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="28" background="images/lookup_toolbar_bg.gif">
  <tr align="left" valign="middle" background="images/lookup_toolbar_bg.gif">
    <td  height="28"><img src="images/transpxl.gif" width="5" height="5"></td>
    <td  height="28"><#MYENTITIES width="38" border=0 height="19" name="myentities" title="My <#tablelabel>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('mycontacts','','images/my_contacts_over.gif',1)" onMouseDown="MM_swapImage('mycontacts','','images/my_contacts_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="5" height="5"></td>
    <td  height="28"><#RECENTENTITIES width="34" border=0 height="19" name="recentntities"  title="Recent <#tablelabel>" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('recentcontacts','','images/recent_contacts_over.gif',1)" onMouseDown="MM_swapImage('recentcontacts','','images/recent_contacts_down.gif',1)"></td>

    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>

    <td  height="28"><#MYRECORD width="28" border=0 height="19" name="myrecord"  title="My Record" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('myrecord','','images/my_record_over.gif',1)" onMouseDown="MM_swapImage('myrecord','','images/my_record_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>

<!--New contact-->
    <td  height="28"><#ACTION function=subentity stable=<#table> new=y page=<#editpage> border=0 name="newentity" title="New <#tablelabel>" image="images/new_entity.gif" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('newentity','','images/new_entity_over.gif',1)" onMouseDown="MM_swapImage('newentity','','images/new_entity_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>

<!-- new sub entity items for entire lookup/note, call, meeting, todo -->
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#ACTION function=subentity stable=wce_history field="htype=Note" target=NewNote  title="New Note (entire lookup)" openparams="height=500,width=700,resizable=yes" image="toptoolbar/new_note.gif" border=0 width="22" height="19" align="absmiddle" name="note" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('note','','toptoolbar/new_note_over.gif',1)" onMouseDown="MM_swapImage('note','','toptoolbar/new_note_down.gif',1)"></td>
    <td  height="28"><#ACTION function=subentity stable=wce_activity field="atype=Call" target=NewCall title="Schedule Call (entire lookup)" openparams="height=500,width=500,resizable=yes" image="toptoolbar/schedule_call.gif" border=0 width="22" height="19" align="absmiddle" name="call" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('call','','toptoolbar/schedule_call_over.gif',1)" onMouseDown="MM_swapImage('call','','toptoolbar/schedule_call_down.gif',1)"></td>
    <td  height="28"><#ACTION function=subentity stable=wce_activity field="atype=Meeting" target=NewMeeting title="Schedule Meeting (entire lookup)" openparams="height=500,width=500,resizable=yes" image="toptoolbar/schedule_Meeting.gif" border=0 width="22" height="19" align="absmiddle" name="meeting" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('meeting','','toptoolbar/schedule_meeting_over.gif',1)" onMouseDown="MM_swapImage('meeting','','toptoolbar/schedule_meeting_down.gif',1)"></td>
    <td  height="28"><#ACTION function=subentity stable=wce_activity field="atype=Todo" target=NewTodo title="Schedule Todo (entire lookup)" openparams="height=500,width=500,resizable=yes" image="toptoolbar/schedule_Todo.gif" border=0 width="22" height="19" align="absmiddle" name="Todo" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Todo','','toptoolbar/schedule_Todo_over.gif',1)" onMouseDown="MM_swapImage('Todo','','toptoolbar/schedule_Todo_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>

    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>

<!-- table lookup icons -->
    <td  height="28"><#action function=lookup etable=<#table> page=lookup_<#table>.html title="Refresh Lookup" image="images/lookup_contact.gif" border=0 align="absmiddle" name="lue" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('lue','','images/lookup_contact_over.gif',1)" onMouseDown="MM_swapImage('lue','','images/lookup_contact_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="5" height="5"></td>
    <td  height="28"><#action function=lookup etable=wce_contact page=lookup.html title="Contact Lookup" image="images/lookup_contact.gif" border=0 align="absmiddle" name="luc" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('luc','','images/lookup_contact_over.gif',1)" onMouseDown="MM_swapImage('luc','','images/lookup_contact_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="5" height="5"></td>
    <td  height="28"><#action function=lookup etable=wce_history ptable=wce_contact page=lookup_wce_history.html title="History Lookup" image="images/lookup_history.gif" border=0 align="absmiddle" name="luh" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('luh','','images/lookup_history_over.gif',1)" onMouseDown="MM_swapImage('luh','','images/lookup_history_down.gif',1)"></td>

<!-- select columns -->
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#COLUMNSELECT title="Change Fields" image="images/lookup_column.gif" border=0 align="absmiddle" name="lcf" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('lcf','','images/lookup_column_over.gif',1)" onMouseDown="MM_swapImage('lcf','','images/lookup_column_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>

<!-- Print -->
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#PRINT width="24" border=0 height="19" name="print" title="Print" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('print','','images/print_over.gif',1)" onMouseDown="MM_swapImage('print','','images/print_down.gif',1)"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>

<!-- Edit Replace -->
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#EDITREPLACE width="28" border=0 name="editreplace" title="Edit Replace" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('editreplace','','images/editreplace_over.gif',1)" onMouseDown="MM_swapImage('editreplace','','images/editreplace_down.gif',1)"></td>

<!-- Delete Lookup -->
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#DELETELOOKUP border=0 name="ideletelookup" title="Delete Lookup" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('ideletelookup','','images/deletelookup_over.gif',1)" onMouseDown="MM_swapImage('ideletelookup','','images/deletelookup_down.gif',1)"></td>

<!-- Previous Lookups -->
    <td  height="28"><img src="images/transpxl.gif" width="15" height="5"></td>
    <td  height="28"><#IFNOTREPORT VALUE="<img src=images/vert_divider.gif width=22 height=16 border=0>"></td>
    <td  height="28" nowrap class=text>Previous: <#previouslookup></td>
    <td  height="28" width=90%> </td>
  </tr>
</table>

<table>
<tr>
<td><img src="images/tranpxl.gif" width="10" height="1"></td>
<td><span class=hdr>Lookup:</span></br>

<!--
Use CommonLookup to include fields, omit fields, or add parameters to all Lookup tags below
Or use parameters in lookup tags to apply only to that lookup tag
Parameters include:
FieldParams=[parameters] - applies to all left side fields in lookup/value pairs
OperatorParams=[parameters] - applies to all operator drop downs
FieldValueParams=[parameters] - applies to all right side fields in lookup/value pairs
Separator=separatorvalue - separator between left/operator/right - default is a single space
Field=[fieldname] - use one or more to limit to only these fields.  Use Field=all for all fields (default)
-Field=[fieldname] - use one or more to suppress field
For operator field - use following for labels:
StartsWithLabel
EqualsLabel
EndsWithLabel
ContainsLabel
GreaterThanLabel
GreaterEqualThanLabel
LessThanLabel
LessEqualThanLabel
IsBlankLabel
NotBlankLabel
-->
<#commonlookup class="LookupDropdownClass">
<table><tr><td valign=top nowrap>
<#lookup ><br>
<#lookup ><br>
<#lookup ><br>
<#lookup ><br>
<#lookup >
</td><td valign=top nowrap>
<#lookup ><br>
<#lookup ><br>
<#lookup ><br>
<#lookup ><br>
<#lookup>
</td><td valign=top nowrap class=text>
 &nbsp; &nbsp; Or Lookup <input type=checkbox name=orlookup value=Y class=checkbox><br>
 &nbsp; &nbsp; Add To Lookup <input type=checkbox name=addtolookup value=Y class=checkbox><br>
 &nbsp; &nbsp; Narrow Lookup <input type=checkbox name=narrowlookup value=Y class=checkbox><br>
</td>
</tr>
<tr><td colspan=2 align=right class=text>Keyword Search: <input name=keyword class="LookupTextFieldClass"> &nbsp; &nbsp; &nbsp; <input type=submit value="Lookup Now" class=button></td>
<td></td></tr>
</table>

</td>
</tr>
</table>
<#/noprint>

<table width=100% cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/tranpxl.gif" width="1" height="1"></td>
<td class=msg align="left"><span class=text>
<#RMID VALUE="My <#tablelabel>:">
<#RCID VALUE="Recent <#tablelabel>:">
<#LUID VALUE="Lookup Results:">  <img src=images/transpxl.gif height=1 width=250 border=0 ><#jump items=5 golabel=" &nbsp;  &nbsp; Jump To: " style="width=25; height=17;">
</span>
</td>
</tr>

<tr>
<td><img src="images/tranpxl.gif" height="5" width="1"></td>
<td></td>
</tr>

<tr>
<td><img src="images/tranpxl.gif" width="1" height="1"></td>
<td class="text">
<#SHOWRESULTS WIDTH=100% BORDER=0 COUNT=25>
</td>
</tr>
<tr><td colspan=2> &nbsp;
<#IFNOTREPORT VALUE="<input name=subfunction value='Lookup Selected' type=submit> &nbsp; <input name=subfunction value='Omit Selected' type=submit>">
</td></tr>

</table>
</body>
</html>
<#detail>
<tr>
<td class=r<#LINE CYCLE=2> style="width=0.1in;padding:0in 0in 0in 0in;"><#select class=text></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname] link=yes blank="blank" show=always></td>
<td class=r<#LINE CYCLE=2> align=center valign=center><#delete></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
<td class=r<#LINE CYCLE=2>><#field field=[fieldname]></td>
</tr>
<#/detail>
<#predetail>
<table border="1" cellspacing="0" style="border-collapse: collapse; border-style: solid; border-color: #FFFFFF; background-color: #FFFFFF" bordercolor="#111111" width="100%" bordercolorlight="#E9E9E9" bordercolordark="#E9E9E9" align="center" cellpadding="3">
<tr>
<td></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
<td class=hdr><#LABEL field=[fieldname] sortable=yes></td>
</tr>
<#/predetail>
<#postdetail>
</table>
<table cellspacing=2 cellpadding=2 border=0 width=30%>
<tr><td class=text><#COUNT><#incomplete></td><td class=text><#FIRST title="First"></td><td class=text><#PREV title="Prev"></td>
    <td class=text><#NEXT title="Next"></td><td class=text><#LAST title="Last"></td>
    <td><#entitylookup></td></tr>
<#incomplete title="<tr><td class=text colspan=6>*Not all records were returned</td></tr>">
</table>
<#/postdetail>

Add Feedback