|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Revision > OnCheckout.LST script file |
It is executed when checking out a document. Using this script it is possible to control the way a document is checked out, basing on rules that can be implemented in the script itself.
Options→Revisions
@DOCUMENT_UNIQUE_ID |
uid of the doc to checkout |
@OKCHECKOUT |
0: fail; 1: ok to proceede |
OnUnCheckout.LST script file
OnCheckoutRecord.LST script file
Suppose we want to avoid the checkout 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 "@OKCHECKOUT","0",ForWriting
exit sub
end if
id = DBWQueryByUid( uid, DBWLookUp("NAME_FIELD_ID") )
if left(id,2)="Pa" then
DBWOutput "@OKCHECKOUT","0",ForWriting
else
DBWOutput "@OKCHECKOUT","1",ForWriting
end if
end sub