|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > Database > UpdateDatabaseActiveDoc |
This command has the primary goal to register document in the database without performing a save on the file.
More, it updates the database with the structure/data of the active opened document.
It works also with checked-out documents and it is equivalent, from a database point of view, to a <shift> REFRESH operation.
No input is asked to the user.
call DBWShell("UpdateDatabaseActiveDoc [show_input [fullyResolveFirstLevelComponents [traverseFullReleasedStructure[refreshSharedCheckedInFiles]]]]")
show_input |
Optional. Shows or not the input when updating database |
|---|---|
fullyResolveFirstLevelComponents |
Optional. |
traverseFullReleasedStructure |
Optional. |
refreshSharedCheckedInFiles |
Optional. |
Please note that the command does not save the file, that should be saved with the swSave command, before using the RefreshSharedCheckedInFiles parameter.
This script is an example of the file OnSave.LST
It performs a database update for each DBWorks "Save" action.
Sub main()
DBWInit(TRUE)
pathName = DBWInput("@DOCUMENT_PATHNAME")
fname = DBWInput("@DOCUMENT_FNAME")
fext = DBWInput("@DOCUMENT_FEXT")
fdir = DBWInput("@DOCUMENT_FDIR")
uid = DBWInput("@DOCUMENT_UNIQUE_ID")
bef_aft = DBWInput("@EVENT_TYPE")
if bef_aft = 1 then
state = DBWQueryByUid( uid , "STATE" )
if state = "BEING_MODIFIED" then
DBWShell("UpdateDatabaseActiveDoc 1")
end if
end if
end sub