|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWGetLinks |
Retrieves unique id of parents/children documents related to the current one.
Function DBWGetLinks(uid, byref linkList, linkType, optionalQueryFilter)
uid |
it is the unique id of the document |
|---|---|
linkType |
if 0:look for children |
optionalQueryFilter |
It is an optional filter to apply in the search. It must be in sql standard syntax. |
The function assumes as value the number of linked documents found.
linkList |
It is an array containing the unique ids of the documents found. |
Dim drawingList()
n = DBWGetLinks( uid, drawingList, 1, " AND T IN ('D')" )
msgbox "I've found " & n & " documents"
sub main()
DBWINIT(TRUE)
DBWShell("CurrentDocument")
uid = DBWResult("@DOCUMENT_UNIQUE_ID")
dim linklist()
optionalQueryFilter = ""
numchildren = DBWGetLinks(uid, linkList, "0", optionalQueryFilter)
numparents= DBWGetLinks(uid, linkList, "1", optionalQueryFilter)
dbwmsgbox "children=" & numchildren & vbcrlf & "parents=" & numparents
end sub