|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Event Scripts > DataForm > OnEdit.LST script file |
It is executed every time the input form is opened for viewing, for editing or when saving a new document.
Options→Data Input
any field name |
|
|---|---|
@EDIT |
1: the record exists in the DB and an EDIT operation is in progress |
@INSERT |
1: the record does not exist in the DB and an INSERT NEW RECORD operation is in progress |
@UNIQUE_ID |
uid ( only when @EDIT=1 ) |
@CURRENT_PROJECT |
the name of the current project (highlighted by the red arrow in the TreeProject)
|
@SELECTED_PROJECT |
the name of the currently selected project in the Data Input Form
|
@PARENT_WINDOW_TITLE |
the title of the window the script has been called from |
@PARENT_WINDOW_HANDLE |
the handle (long integer) of the window the script has been called from |
@CURRENT_DATAENTR_TXT_FILENAME |
it allows the script developer to understand what is the current FORM definition file that invoked the script. For example, the developer can open such form definition file and look for what field names are listed into it. |
@REVISION_PHASE |
this variable is passed if not null only; Remarks
|
@OKDATA |
1: automatic confirmation for the standard input form (such as clicking OK button); |
|---|---|
.VBSCRIPT
Sub main()
DBWInit(TRUE)
inEdit = DBWInput("@EDIT")
inInsert = DBWInput("@INSERT")
Descr = DBWInput("DESCRIPTION")
Notes = DBWInput("NOTES")
'DBWMsgBox "edit=" & inEdit & vbcrlf & "insert=" & inInsert
if inEdit = 1 then
DBWOutput "DESCRIPTION",Descr & "- added by ONEDIT.LST",ForWriting
DBWOutput "NOTES",Notes & "- added by ONEDIT.LST",ForAppending
end if
if inInsert = 1 then
DBWOutput "DESCRIPTION","New description created by ONEDIT.LST",ForWriting
DBWOutput "NOTES","New note created by ONEDIT.LST",ForAppending
end if
End Sub