DBWDemo.vbs

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Examples >

DBWDemo.vbs

Sub main()

 DBWInit(TRUE)
 'retrieve info about the document currently selected in the browser
 call DBWShell("CurrentDocument")
 if (okDBW = False) then
  exit sub
 end if
 docUId = DBWResult("@DOCUMENT_UNIQUE_ID")
 'given the uid, retrieve the FILE_NAME of the document by querying the database
 fName = DBWQueryByUid( docUId , DBWLookup("NAME_FIELD_FILE_NAME") )
 if (okDBW = False) then
  exit sub
 end if
 'given the uid, retrieve the FILE_DIRECTORY of the document by querying the database
 fDir = DBWQueryByUid( docUId , DBWLookup("NAME_FIELD_FILE_DIRECTORY"))
 if (okDBW = False) then
  exit sub
 end if
 'show the retrieved data
 DBWMsgBox "DOCUMENT PATH: " & fDir & fName
End Sub