|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWGetChildren |
Retrieves a list of current document first level children.
Function DBWGetChildren(DocUID, ByRef ChildList, optionalQueryFilter)
DocUID |
it is the unique id of the root document |
|---|---|
optionalQueryFilter |
It's 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' " To not to specify any further filter, enter an empty string. |
The function assumes the value of the number of records found.
If no record has been found the function assumes a zero value.
ChildList |
array containing the unique ids of parent documents. |
Function DBWGetParents
Sub main()
dim arr_children_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_children = DBWGetChildren(docUId, arr_children_uid, "")
dbwmsgbox num_of_children & " children found"
str = "Children UID list:" & vbcrlf
for i=0 to num_of_children-1
str = str & arr_children_uid(i) & vbcrlf
next
dbwmsgbox str
end sub