|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWGetParents |
Retrieves a list of current document parents.
Function DBWGetParents(uid, ByRef ParentList, optionalQueryFilter)
uid |
the unique id of the root document |
|---|---|
optionalQueryFilter |
a further specification for the search. This it's a part of a query, so you've to set it in this way: " AND <condition> " For example you can specify that you want only certain documents (projects, parts, ...). " AND T='0' " |
The function assumes the value of the number of records found.
If no record has been found the function assumes a zero value.
ParentList |
array containing the unique ids of parent documents. |
Function DBWGetChildren
Sub main()
dim arr_parents_uid()
DBWInit(TRUE)
'retrieve the currently selected document uid
call DBWShell( "CurrentDocument" )
if (okDBW = False) then exit sub
docUId = DBWResult( "@DOCUMENT_UNIQUE_ID" )
num_of_parents = DBWGetParents(docUId, arr_parents_uid, "")
msgbox num_of_parents & " parents found"
str = "Parent UID list:" & vbcrlf
for i=0 to num_of_parents-1
str = str & arr_parents_uid(i) & vbcrlf
next
msgbox str
end sub