|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Database > OnAddAttachment.LST script file |
This script is executed every time a new attachment is added to an existing document.
Options→General
@DOCUMENT_UNIQUE_ID |
the unique id of the existing DOCUMENT record you are adding an attachment to. |
|---|---|
@DOCUMENT_PATHNAME |
the full path name of the attachment |
@OKADD |
0: stop adding |
Avoid adding attachment if parent document is not in checked-out state
'x64
.VBSCRIPT
Sub Main()
DBWInit(True)
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
state = DBWQueryByUid(uid,DBWLookup("NAME_FIELD_STATE"))
okAdd = 0
If UCase(state) = UCase(DBWLookup("NAME_STATE_BEING_MODIFIED_STRING")) then
okAdd = 1
End If
DBWOutput "@OKADD",okAdd,ForWriting
End Sub