UpdateDatabaseActiveDoc

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > Database >

UpdateDatabaseActiveDoc

Description

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.

Syntax

call DBWShell("UpdateDatabaseActiveDoc [show_input [fullyResolveFirstLevelComponents [traverseFullReleasedStructure[refreshSharedCheckedInFiles]]]]")

Parameters

show_input

Optional. Shows or not the input when updating database
0: not show
1: show
2: not show and not update LAST_MODIFIED_DATE
3: show and not update LAST_MODIFIED_DATE

fullyResolveFirstLevelComponents

Optional.
0: (default) don't resolve
1: resolve

traverseFullReleasedStructure

Optional.
0: (default) don't traverse checked-in and released documents
1: traverse with no care about the document's state Shows or not the input when updating database

refreshSharedCheckedInFiles

Optional.
0: (default) don't refresh
1: refresh
This parameter is significative only when running in Local Checkout Mode, and updates the files in the Shared Checked In directory with the currently saved checked-out copies of the main file, and, if the traverseFullStructure parameter is set to 1 as well, of the saved checked-out copies of the 1st level child components.

Remarks

warning Please note that the command does not save the file, that should be saved with the swSave command, before using the RefreshSharedCheckedInFiles parameter.

Example

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