GetSortedUIDListForProcessing

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > Database >

GetSortedUIDListForProcessing

available from build: 20230714

Description

Given a list of unique_ids, this command returns the same list sorted in the suitable priority to be released/checkedin/checkedout.

Syntax

call DBWShell("GetSortedUIDListForProcessing uidList  mode  [showLinkedDrawings [checkForeignDocuments [NoTraverseChildren [NeverReturnLinkedDocuments]]]] ")

Parameters

uidList

A comma separated list of document unique_id to be processed


mode

0: Checkout
1: Checkin
2: Approve


showLinkedDrawings

Optional.
0:exclude any linked drawing
1:include any linked drawing


checkForeignDocuments

Optional.
0:enable the row if the document is foreign
1:disable the row if the document is foreign


NoTraverseChildren

Optional.
0: traverses children tree
1: avoids the recursion through all the document's children - useful for "drawings only" lists


NeverReturnLinkedDocuments

Optional.
0: returns also document linked to selected ones (e.g. configs)
1: doesn't return linked documents


Remarks

Please note the command is based on the core processing of the DocumentSelectorDialog that is shown during recursive revision actions.

Results

@SORTED_UID_LIST

a comma separated list of unique_ids in the proper order to be processed for the mode action.

See also

ShowDocumentSelectorDialog command

Example

sub Main()

 DBWInit(TRUE)
 if (okDBW) then
  selection = "11548,11542,11543"  'input document unique id list to sort
  mode = "2"                       '0=checkout, 1=checkin, 2=approve
  showLinkedDrawings = "1"         '0/1 exclude/include any linked drawing
  CheckForForeignDocuments = "0"   '0/1 include/exclude the document if foreign
  NoTraverseChildren = "0"         '0/1 allow/avoid the recursion through all children
  NeverReturnLinkedDocuments = "1" '0/1 include/exclude linked documents (e.g. configs)
  'SORT LIST
  DBWShell("GetSortedUIDListForProcessing " & selection &_
  " " & chr(34) & mode & chr(34) &_
  " " & chr(34) & showLinkedDrawings & chr(34) &_
  " " & chr(34) & CheckForForeignDocuments & chr(34) &_
  " " & chr(34) & NoTraverseChildren & chr(34) &_
  " " & chr(34) & NeverReturnLinkedDocuments & chr(34))
  selection = DBWResult("@SORTED_UID_LIST")
  DBWMsgBox selection
 end if
End sub