Customising Lookup.html

Root > 3. Customisation

 

 

    Follow WiredContact on Twitter
 
Lookup.html
 
  The Lookup function gives the user the ability to find records in the database.
The Lookup function is similar to the Query function, but the Lookup function has more options for displaying, modifying, adding, and working with records than the Query function.


The default Lookup page can be divided into three sections - the toolbar section, the Lookup section, and the results section.

Default Behavior

  • Template - the default template is identified in the Table Defaults but that can be overridden in the function call via the &page=[template name] parameter. The typical function call for the Lookup function would be:
    wceweb.dll?function=lookup&etable=[table name]
  • The Lookup function is often called from the Sidebar. Lookup icons also
    apear in the Toolbar of a Lookup page to perform the Lookup function on
    additional tables. The Lookup function is also often called from a 
    Subentity List function template.
General Tags - many WiredContact tags are similar to tags for other functions.
Also, there are many tags that are only useful in rare or specific instances.

This may require a discussion

Toolbar Section
This section has the icons that allow the user to move quickly to one click
lookups, navigate to the user's contact record, schedule activities, or add
notes, history items, or other Subentity items, print, use Edit/Replace, Delete,
and many other activities.

Toolbar Section Tags

  • <#Recent... creates a lookup based on the CreateDate field specified
    in the Table Defaults. The default behavior is to show records created
    within the past 10 days.
    Parameters
    • Days=x - specifies how many days to show - the default is 10
    • Edit - Uses the EditTime field instead of the CreateTime field
    • Image=[path] - use image for function icon
    • page=[template] - override default template for this function
    • Teams=yes - limits lookup to those records where the
      RecordManager is a Team Member of the current user
    • Recordmanager=yes - limits lookup to those records where the
      user is the RecordManager
    • RecordmanagerREdit=yes - limits lookup to those records where
      the EditUser field is the current user
  • <#MyEntities...> creates a lookup based on the RecordManager field
    specified in the Table Defaults.
    Parameters
    • Teams=yes - limits lookup to those records where the
      RecordManager is a Team Member of the current user
    • Image=[path] - use image for function icon
    • page=[template] - override default template for this function
  • <#MyRecord...> - displays a link to the contact record assigned to
    the current user. From the contact record, the user may update user
    address/phone/email as well as link to the User Settings dialog for that user
  • <Action..> tags
  • <#ColumnSelect...> - Allows the user to change the columns displayed
    on the lookup results
  • <#EditReplace...> - If the user has permission to perform Edit/Replace,
    displays the dialog that will bring up the Edit/Replace dialog
  • <#DeleteLookup...> - If the user has permission to perform Delete Lookup
    and Delete, displays the dialog that will bring up the Delete Lookup dialog
Lookup Section
This section contains the elements that allow a user to specify which records to show.
Lookup Section Tags
  • <WCETAGS> - this tag is mandatory for using the new style Lookup
    Section tags. Place this tag in the <head> section. New style Lookup Section
    tags offer more customization opportunities. Old style Lookup Section tags are
    no longer supported. For any of the Lookup Section tags to work properly, this
    tag must come before those tags in the template.
  • <#Lookup...> - defines the field/operator/value sets used to lookup values in
    the table. The field is typically a dropdown with one or more database fields
    in the dropdown. The operator is typically "Starts With" and includes other
    standard operators. The value is the form field that the user will enter
    information into in order to find records in the table. All attributes of each of
    these items may be customized.
    Parameter:
    • Field=[field name] - by default, the <#lookup tag shows all fields in the
      field dropdown list. When you include one or more field=[field name]
      parameters, only those fields specified are shown. If the fields were
      previously restricted (via a <#CommonLookup or <#CommonField tag),
      then using -field=all parameter will remove all fields, and only additional
      field=[field name] tags will be shown. Using Field=All will return the list
      to all fields.
    • -Field=[field name] - by default, the <#lookup tag shows all fields in the
      field list. When you include one or more -field=[field name] parameters,
      those fields will be removed from the field dropdown list.
    • FieldClass=[class name] will add the stylesheet class to the field
      dropdown list
    • ValueClass=[class name] will add the stylesheet class to the value
      form field
    • OperatorClass=[class name] will add the stylesheet class to the
      operator field dropdown list
    • FieldParams=[parameter list] will add the parameter list to the field
      dropdown list
    • ValueParams=[parameter list] will add the parameter list to the value
      form field
    • OperatorParams=[parameter list] will add the parameter list to the
      operator field dropdown list
    • Separator=[value] where value is what separates the field from the
      operator, and the operator from the value. The default separator is a
      single space.
    • Operator Labels - the Operator Labels are shown in the Operator Field
      dropdown list. Setting an operator label to an empty string will remove
      the operator from the operator list.
      Operator labels and default values:
      • StartsWithLabel="*="
      • ContainsLabel="*"
      • EqualsLabel="="
      • GreaterEqualThanLabel=">="
      • LessEqualThanLabel="<="
      • GreaterThanLabel=""
      • LessThanLabel=""
      • IsBlankLabel=""
      • NotBlankLabel=""
      • NotEqualsLabel=""
      • NotContainsLabel=""
      • NotStartsWithLabel=""
    • UseCustomOperator=No - suppresses the Operator Field Dropdown
      List and uses "Starts With" as the operator.
  • <#LookupParent...> - when using a subentity lookup, this tag will display a field/dropdown/value set for the parent table. This tag uses the same
    parameters as the <#Lookup tag
  • <#CommonLookup...> - when placed before one or more <#Lookup...>
    tag(s) in the template, the parameters specified will be used with all <#Lookup...>
    tags that follow.
  • <#CommonFields...> - only uses field=[field name] and -field=[field name]
    parameters, when placed before one or more <#Lookup...> tag(s) in the
    template, the parameters specified will be used with all <#Lookup...> tags
    that follow.
  • special HTML input tags - several standard html input tags may be used in
    the Lookup section:
    • <input type=checkbox name=orlookup value=Y class=checkbox> -
      shows a checkbox that when checked changes the lookup from the
      default "AND" query to an "OR" query
    • <input type=checkbox name=addtolookup value=Y class=checkbox> -
      shows a checkbox that when checked changes the default behavior to
      add to the existing lookup instead of replacing it
    • <input type=checkbox name=narrowlookup value=Y class=checkbox> -
      shows a checkbox that when checked changes the default behavior to
      narrow the existing lookup instead of replacing it
  • <#radio...> - alternate method of end user lookups. This tag will display a
    radio button that if selected will use the parameters in the end user's query.
    The parameters include: Field=[field name] operator=[operator] value="Value".
    Here's an example using the IDStatus field:

     

    All <#radio field=idstatus value="" checked operator="equals">
    Customer <#radio field=idstatus value="Customer">
    Prospect <#radio field=idstatus value="Prospect">

     

  • <#Limits value="[sql limits]"> - adds the [sql limits] to every query done
    by the lookup function. This tag adds a hidden input tag:
    <input name=limits value="[sql limits]"> - you may modify this input tag via
    javascript to create checkboxes or radio buttons that wil add complex SQL
    to the lookup queries.
Results Section
This section describes how to show the results of the user's Lookup, which data
elements to show, and which data elements the end user will be able to modify
directly in the results without navigating to a different page.
Results Section Tags
  • The main results section uses WiredContact Detail Section Use Ajax Tags
    to display icons for exploding views.
  • <#ShowResults...> - displays the lookup results.
    Parameters:
    • Count=[x] - where [x] is the number of records to show on a page.
      Fewer records per page improves performance.
    • OrderBy=[Order By Clause] - Specify an alternate default sort order.
  • <#ShowSQL> - displays the last query's SQL statement. For debugging
    purposes. This tag must come after the <#ShowDetails> tag.
General Tags
  • Service Tags including <#params and <#date
  • <#PRINT...> - displays the Print icon - when clicked brings up the current
    Lookup. By using the <#noprint>/<#/noprint> tags, you can exclude text
    from the Lookup Print function. For example:
    Some Text
    Some text
    <#noprint>
    Text not shown with Print function
    Text not shown with Print function
    <#/noprint>
    Some Text
    Some text
     
    This tag is easier to use than the <#MSGNOPRINT value="text to show
    when not using the Print Function"> tag.
    Parameters
    • IMG=[image file path] - the default is images/print.gif
    • Page=[Template Name] - if you want to use a different template
      than the default template
    • Count=x - where x is the number of items to limit the report to.
  • <#MSGPRINT value="Text to show only with the Lookup Print function">
  • <#UserField...>tag
  • <#SysUserField...> tag
  • <#include...> tag
  • <#LayoutTest...> tag
  • <#ParentSecurity>
  • Static Report
  • Wizard Report
  • <AjaxJS...> tag
  • <AjaxResults..> tag
  • <#TABLENAME> - is replaced with the table's name specified in the
    Table Defaults:Label field
  • <#SITEMESSAGE name=[site settings parameter name]> - is replaced
    with the value of the Site Setting You may use Admin...Site Settings...Misc Settings...Custom Settings to specify a site setting, or create your own
    Admin Site Settings template to create a custom message to display
  • on the Lookup.
  • <#TEAM> - is replaced with the user's first team.
  • <#TEAMS> - is replaced with all of the the user's teams, separated by
    commas.
  • <#TABLEDEFAULT name=[default parameter name]> - displays the value
    of a Table Default parameter
  • <#DBPARAMS paramname=paramvalue> - overrides the Table
    Defaults setting the [paramname] to the new [paramvalue]. Primarily used
    when using the lookup function with a subentity table to modify the default delete
    and edit functions. For example, the default template for a subentity would typically
    be the list view template for viewing under the entity. But when linking to the
    subentity view from the lookup, the main template would be would be the Edit view template.
  • <#LOGPARAMS> - display the complete parameters list in the WiredContact
    Errors.log file
  • <#LOGDBPARAMS> - display the complete Table Defaults in the WiredContact
    Errors.log file
  • <#ALLOWBLANKENTITYID> - under special circumstances, you may want to do
    a lookup where a uniqueid is not available. Use this tag to override the default behavior which prohibits records with no uniqueid
  • <#DUPLICATESUPPRESS field=fieldname field=fieldname ...> - don't show
    duplicate records. When the results are sorted, if the values for the fields in the
    next record match the values in the current record, the next record will not be shown.
  • <#REVERSESORT field=fieldname field=fieldname ...> - where the fields are those
    that you want an initial Descending sort instead of the default Ascending sort.
  • <#RMID value="My Contacts List message"> - Informational message when
    the user selects "My Contacts/Entities" from the toolbar
  • <#RCID value="Recent Contacts List message"> - Informational message when
    the user selects "Recent Contacts/Entities" from the toolbar
 
Additional Drop downs needed?
To show the complete list on the left hand side as well as the right hand side to show all fields just pase this code over the existing code.
 
<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=bottom 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>
 

 


Regional details are also available at http://www.wiredcontact.co.uk

Add Feedback