KBA-01564: Overview of the PresetSearch Rules

Overview:

The PresetSearch rules define preset named Catalog searches for use in the system. See also KBA-01598.

The PresetSearch rule group is found in the Rules Maintenance tool on the System Admin Dashboard. Each rule in the group consists of a rule name, a filter value (which can be blank) and a result value.


Filter Value:

Query parameter ID

The PresetSearch rules take an ID (which is user defined for each named search) as the filter value except where noted.


Result Value:

Varies

Result values for the PresetSearch rules depend on the rule and are indicated within the description of each rule. Some rules are enabled and disabled through a checkbox in the result value, for example:

checkbox result value


Rules:

AutoSearch

Specifies (in the result value checkbox) whether the search should be performed immediately and also each time the filters are changed.

  • unchecked = No (default).
  • checked = Yes.

Closed

Specifies (in the result value checkbox) whether closed documents should be included in the search results.

  • unchecked = No (default).
  • checked = Yes.

DaysAgo

Specifies (in the result value) the number of days prior to today to include in the search results. Default is 366. If you specify a number greater than 20,000,101, the number is interpreted as YYYYMMDD.   Use Default as the filter to configure the general dashboard default (reduced from 700 to 400 in v2020).  This value filters against DocDate.

DocType

Specifies (in the result value) the Doc type by which to limit the search results.

Documents

Specifies (in the result value checkbox) whether documents should be included in the search results.

  • unchecked = No (default).
  • checked = Yes.

DueSince

Specifies (in the result value) the number of days prior to today to mark the Due date or after by which to filter the search results. For example, if today is 4/12 and you specify DueSince = 7, the results will be limited to documents with a Due date of 4/5 or after. If you specify a number greater than 20,000,101, the number is interpreted as YYYYMMDD.   Use 0 (zero) to remove the filter (which is the default).

Filename

Specifies (in the result value) a mask for filenames to limit search results.

FileDrop

Specifies (in the result value checkbox) whether files can be added to the Catalog via drag and drop. In order to enable this option, the Files rule (below) must also be enabled.

  • unchecked = No (default).
  • checked = Yes.  Ignored if Files is not also checked (below)

Files

Specifies (in the result value checkbox) whether files should be included in the search results.

  • unchecked = No (default).
  • checked = Yes.

Folder

Specifies (in the result value) the folder (if any) whose files should be included in the search results. Paths must begin with a slash (/).

JSIncludes

Specifies (in the result value) the JavaScript resources that should be included when the search tab is rendered. If no slash ( / ) is included in the result value, the /cscript/ folder is assumed. If the path starts with */, the zPublicHTML/js folder in the catalog is used and a .js extension is automatically added.  The script you include can use jQuery,

Lock

Specifies (in the result value) a semicolon-separated list of locked filters. Locking a filter hides it from the screen, preventing users from expanding or changing the search. Possible locked filters include:

  • AutoSearch = hide the Auto Refresh checkbox.
  • Closed = hide the Include Closed checkbox.
  • DocAttrType = hide the Has Attribute checkbox.
  • DocAttrValue = hide the Attribute Value drop-down.
  • DocDate = hide the Date fields.
  • DocNo = hide the Doc# field.
  • DocStatus = hide the Status drop-down.
  • DocTitle = hide the Title filter (documents only)
  • DocType = hide the Type drop-down.
  • Documents = hide the Include Documents checkbox.
  • Due = hide the Due date fields.
  • Files = hide the Include Files checkbox.
  • HasAttachments = hide the Has Files checkbox.
  • IsCompanyMode = hide the Company Wide checkbox.
  • IsSubcontractor = hide the Project Purchasing checkbox.
  • MaxItems = hide the Max Items field.
  • PerPage = hide the Per Page field.
  • Project = hide the Project ID lookup field.
  • Reference = hide the Reference lookup field.
  • ReferenceDate = hide the Ref Date fields.
  • ResponsibleParty = hide the Responsible lookup field.
  • Search = hide the Text field.
  • SearchNow = hide the Search button.
  • SourceCompany = hide the Company field.
  • SourceContact = hide the Contact lookup field.
  • SourceDocNo = hide the Source # field.
  • SourceScope = hide the Scope drop-down.
  • Subcontract = hide the Commitment field.
  • SubType = hide the Subtype drop-down.
  • Task = hide the Cost Code field.

MaxItems

Specifies (in the result value) the maximum number of search results to be displayed.

PageTitle

Specifies (in the result value) the text to appear in the header at the top of the tab page and also on the drop-down from the Catalog tab. Note: Apostrophes in the title (for example, CCO’s) cause a problem so do not include any.

KBA01564_01

PerPage

Specifies (in the result value) the maximum number of search results to be listed on one page. The default depends on screen size, around 20. Any number between 1 and 255 can be specified.

PersistentTabs

Specifies (in the result value) a semicolon-separated list of preset search filters for which tabs should always be displayed by default.  Each tab takes the form FilterValue,TabNumber separated by commas, for example: TT,80;JS,390 (which, would put TT between Contacts and Executive tab, and JS after System Admin).  Note that other rules to define the tab, using the same filter value, are required.  For reference, the standard tab numbers are:

Home 010
Catalog 020
Contacts 030
Executive 130
Manage 140
System Admin 210

Preview

Specifies (in the result value checkbox) whether files included in the search results may include a preview.

  • unchecked = No (default).
  • checked = Yes.

Project

Specifies (in the result value) a project ID or mask to limit search results. You can use the current user’s tracked project by ending the value with an exclamation mark (!).  If the user has tracked project enabled (as a user preference) the rule result is replaced by the last project ID; otherwise the exclamation mark is removed and the rule value is used.

RefreshMinutes 

[V23+] Specifies (in the result value) the number of minutes after which the catalog should automatically refresh data from the server.  The default is  0 (zero) to disable the automatic refresh. The minimum is 3 minutes. The display will show a countdown /warning for the last 20 seconds.

ShowFileKeywords

Specifies (in the result value checkbox) whether file results should include the keyword/notes column.

  • unchecked = No (default).
  • checked = Yes.

SortDocs

Specifies (in the result value) the column(s) by which to sort document results by default. Include DESC to indicate a descending sort. Multiple column names should be separated by a comma. The default is DocDate DESC, Title. Use the filter value of Default to indicate a new default sort. Possible column names are:

  • DocDate = sort by the document’s date.
  • Due = sort by the document’s due date.
  • Title = sort by the document’s title/description.
  • DocNo = sort by the document’s doc number.
  • Project = sort by the document’s Project ID.
  • FromUser = sort by the “from” user.
  • StatusText = sort by status
  • LastModified = sort by last modified (internally maintained); often used with DESC

The following column names are grouped rather than sorted alphabetically

  • DocReference  group by reference
  • DocTypeKey = group rather than alphabetize by Doc type.
  • ProjectName = sorted by Project ID, effectively grouping by the project name.
  • ResponsibleParty group by the document responsible part
  • SourceContact  the document source contact

SortFiles

Specifies (in the result value) the column(s) by which to sort file results. Include DESC to indicate a descending sort. Multiple column names should be separated by a comma. The default is FileName. Use the filter value of Default to indicate a new default sort. Possible column names are:

  • Cataloged = sort by the Catalog date.
  • ReferenceDate = sort by the Reference date.
  • FileName = sort by the name of the file.
  • Project = sort by the Project ID.
  • ProjectName = sort by the project name.
  • SourceContact = group rather than alphabetize by source contact.
  • Keyword = sort by keywords.

Status

Specifies (in the result value) the document status by which to limit the search results. You can also specify a value for a LIKE expression (such as P%) or a comma-separated list without literals (such as I,P).

Subtype

Specifies (in the result value) the document subtype by which to limit the search results. You can also specify a value for a LIKE expression (such as P%) or a comma-separated list without literals (such as CP,FP,TM).

TabKey

Specifies (in the result value) whether a tab should be added for a search and what it should be labeled.
Note: this rule is overridden by tabs predefined in siteconfig.xml. Only tabs that you want to appear upon login 100% of the time should be defined in siteconfig.xml.

  • 0 = No (default).
  • 1 = Add a tab with the page title (see the PageTitle rule above).
  • label = Add a tab with the specified label.

TabTip

Specifies (in the result value) the text of the mouse-over tip that will appear for the tab.  There is no default.

TreeView

Specifies (in the result value checkbox) whether the folder tree should be displayed to the left of the file results.

  • unchecked = No.
  • checked = Yes (default).

UserFilter

Specifies (in the result value) how the current user might be applied to the catalog filters.  The format is RoleName;FilterName;lock where:

  • RoleName can be either an * or a specific role name (PM or HVAC SUBS or whatever);  Use *  to mean “all users regardless of role membership”. If a role name is specified, the filter is only set if the user is a member of the specified role.
  • FilterName can be either ResponsibleParty or SourceContact.
  • Lock = lock the filter (only if it is set)
  • 0 = leave the filter enabled.

VisibleTo

Specifies (in the result value) a single role name or single user login ID that identifies who can see global preset searches.  Examples: Everyone, Internal Staff, BETTYR.

WithAttachedFile

Specifies (in the result value) the GUID of a file so that only documents with the indicated file attached will appear in the search results.


Additional Comments:

See KBA-01598 for how to define a custom Catalog Search tab.


KBA-01564; Last updated: May 9, 2023 at 8:11 am green text = new
Keywords:  creating a tab, custom tab