|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Library Reference > Database > DBWWhereUsed |
Returns the documents where the current one is used.
Function DBWWhereUsed(DocUID, WhereUsedType, ByRef LastDocUID, ByRef NumOfDoc, ByRef DocUidArray)
DocUid |
It is the unique id of the document of which find users. |
|---|---|
WhereUsedType |
It is a filter to select only some type of document between the users. for every type of doc:<commas><commas> for a single type of doc: <commas><apostrophe>+ type to find+<apostrophe><commas> for multiple type of doc: ... <commas> |
The function assumes the value of the last document found ID.
LastDocUid |
last document found Uinque ID. |
|---|---|
NumOfDoc |
number of found documents. |
DocUidIdArray |
array containing the Unique ids of found documents. |
Sub main()
DBWInit(TRUE)
Dim DocUIdArray()
Dim num_of_doc
Dim LastDocUid
DocUid = 473
WhereUsedType = "'0','P'" 'shows only projects and drawings
LastDocID = DBWWhereUsed(DocUid,WhereUsedType,LastDocUid,num_of_doc,DocUIdArray)
msgbox "Found " & num_of_doc & " documents that use the current one." & _
vbcrlf & "last one has id: " & LastDocID
if num_of_doc>1 then
for i=1 to ubound(DocUIdArray)
msgbox "Found : " & DocUIdArray(i)
next
end if
End Sub