OnBeforeCheckin.LST script file

<< Click to Display Table of Contents >>

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

OnBeforeCheckin.LST script file

Description

It is executed before the execution of the Checkout→Checkin on a document.

Using this script it is possible to halt the checkin process.

Activation

Options→Revisions

Input

@DOCUMENT_UNIQUE_ID

uid of the doc to checkin

@IS_LINKED_DOCUMENT

the currently processed document is 0: the selected/active document; 1: a linked document;
It allows the script to understand if it is called when checking-in the main active document (or the currently selected document in the browser) or if the check-in happens because a related document is being processed by the Drawing ↔ Part Link Mode manager.

Input

@OKCHECKIN

Mandatory
0: cancel the checkin process
1: proceed with checkin process

Remarks

Differently from OnCheckin.LST, that's called only as a notification of the event, this script can interrupt the checkin process.

See also

OnCheckin.LST

Example

.VBSCRIPT
Sub Main
 DBWInit(TRUE)
 uid = DBWInput("@DOCUMENT_UNIQUE_ID")
 res = DBWMsgBox2("Proceed with checkin of " & DBWQueryByUid(uid,DBWLookUp("NAME_FIELD_ID")),4 OR 32,"OnBeforeCheckin.LST")
 If res=6 Then 'VbYes
  DBWMsgBox2 "Proceed with checkin action",64,"OnBeforeCheckin.LST"
  DBWOutput "@OKCHECKIN",1,ForWriting
 Else
  DBWMsgBox2 "Checkin action canceled",16,"OnBeforeCheckin.LST"
  DBWOutput "@OKCHECKIN",0,ForWriting
 End if
End Sub