OnOKFilter.LST script file

<< Click to Display Table of Contents >>

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

OnOKFilter.LST script file

Description

It allows a reassignment of the filter form data for customizing the behavior of the filter, based on specific rules.

It's enabled after pressing the OK in the Filter Data Input Mask.

Activation

Options→Data input

Input

any_field

All the Filter Input Form fields

@REVISION_PHASE

this variable is passed if not null only;
values can be "REVISION_PROCESSED" | "REVISION_APPROVED" | "REVISION_NEW" | "REVISION_ACTIVATED" | "CHECKIN"

Remarks

stateCOUTstateCIN @REVISION_PHASE=CHECKIN

stateNEWstateCIN @REVISION_PHASE=REVISION_NEW

stateRELstateCIN @REVISION_PHASE=REVISION_NEW

Output

@OKDATAFILTER

If 1 confirms filter data.

Example

The following example shows how to always search on any sub-string of the ID field.
The filter, by default, anchors the search to the beginning of every field string;
in order to search a sub-string, the special character % must be prefixed to the search string.
The sample also shows how to avoid searching on specific fields ( in this case, the field COST ).

.VBSCRIPT

Sub main()
 DBWInit(TRUE)
 id = DBWInput("ID")
 if id<>"" then
  id = "%" & id
 end if
 cost = DBWInput("COST")
 if cost<>"" then
  DBWMsgBox "Operation not allowed"
  DBWOutput "@OKDATAFILTER",0,ForWriting
  exit sub
 end if
 DBWOutput "@OKDATAFILTER",1,ForWriting
 DBWOutput "ID",id,ForAppending
End Sub