|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Revision > OnIncrementRevisionState.LST script file |
It is executed when performing an Increment revision state on a document.
Using this script it is possible to control if proceeding with a new revision action, basing on rules that can be implemented in the script itself.
Options→Revisions
@DOCUMENT_UNIQUE_ID |
uid of the document to decide about revision increment |
|---|---|
@IS_LINKED_DOCUMENT |
0: if the scritp is called in the main document |
@OKINCREMENT |
0: not increment; 1: ok to proceede |
Suppose we want to avoid the revision increment of documents whose ID begins with 'Pa'; the script could be written in the following way:
.VBSCRIPT
Sub Main()
DBWInit(true)
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
if uid = 0 then
DBWMsgBox "Error: document unique id is 0!"
DBWOutput "@OKINCREMENT","0",ForWriting
exit sub
end if
id = DBWQueryByUid( uid, DBWLookUp("NAME_FIELD_ID") )
if left(id,2)="Pa" then
DBWOutput "@OKINCREMENT","0",ForWriting
else
DBWOutput "@OKINCREMENT","1",ForWriting
end if
end sub