|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > Database > OnDeleteAttachment.LST script file |
This script is fired when deleting an attachment through the RMB Remove this attachment functionality of the Attachment grid:

Options→General
@DOCUMENT_UNIQUE_ID |
uid of the DOCUMENT record the attachment is linked to |
|---|---|
@DOCUMENT_PATH_NAME |
the attachment full file path |
@OKDELETE |
Validate the attachment deletion |
Allow attachment deletion for checkedout documents only:
'x64
.VBSCRIPT
Sub Main()
DBWInit(True)
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
state = DBWQueryByUid(uid,DBWLookup("NAME_FIELD_STATE"))
okDel = 0
If UCase(state) = UCase(DBWLookup("NAME_STATE_BEING_MODIFIED_STRING")) then
okDel = 1
End If
DBWOutput "@OKDELETE",okDel,ForWriting
End Sub