OnSearch.LST script file

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Event Scripts > Browser >

OnSearch.LST script file

Description

This script is fired when the button for the full text search is pressed

Search_24

By this script it is possible to add an extra condition to the search condition, or to replace the current search condition with a new one.

Activation

User Interface→Browser Behavior→Full text search

Input

@SEARCH_CONDITION

the current search condition as calculated by Mechworks PDM

@SEARCH_STRING

The string value to be searched in the database

Output

@SEARCH_CONDITION

output this parameter if you want to completely replace the search condition calculated by DBWorks with your own

@ADDED_CONDITION

output this parameter if you like to add an extra condition ( combined by DBWorks through the AND logical operator ) to the current condition calculated by DBWorks

Example

The following example shows a OnSearch.LST script that reduces the search results by avoiding any Project document and any file different from .SLDPRT:

.VBSCRIPT

sub main()
 DBWInit(TRUE)
 searchCondition = DBWInput("@SEARCH_CONDITION")
 'DBWMsgBox searchCondition
 DBWOutput "@ADDED_CONDITION","T<>'0' AND FILE_NAME LIKE '%.SLDPRT'",ForWriting
 '
 ' the following lines show how to replace the current search condition with a totally
 ' new condition
 '
 ' newSearchCondition = searchCondition
 ' calculate the newSearchCondition
 ' DBWOutput "@SEARCH_CONDITION",newSearchCondition,ForWriting
 '
end sub