PostDocument
Post document(s) from shared/local to shared cabinet to another user.
Public Function PostDocument(ByVal DestCabinetId As Long, DocumentId() As Long, ByVal RecipientUserid As Long) As Long
Parameters
In/out |
Name |
Data type |
Description |
In |
DestCabinetId |
Long |
Index of the cabinet in which document has to posted |
In,Out
|
DocumentId |
Long |
[In]Iist of indexes of the document which has to posted [Out] list of indexes of the document which has been actually posted |
In |
RecipientUserid |
Long |
Index of the user to whom document has to be posted |
Description
This function is called from desktop for both local and shared cabinet. If the source cabinet is not a local cabinet then this function first fetches the properties of all the document and ensure that the user posting the document should either be the owner of the document or a member of supervisor group. Documents for which this condition violates are not posted. List of only those document is returned back which are actually posted so that they can be deleted at the front end. It also verifies that the recipient user should have read rights on the dataclass in case if any dataclass is attached with the document if the recipient does not have read rights on the document then although document is posted but is not returned in the return list.
Return value
Name |
Description |
1 |
In case of success |
-1 |
Invalid cabinet name |
-3 |
Cabinet not connected |
-90 |
Can not copy dataclass |
-201 |
Insufficient rights for the current operation |
-202 |
Recipient does not have read rights on the data class associated |
-133 |
User not logged in |
Example
Dim DestCabId As Long
Dim DocId() As Long
Dim UserId As Long
Dim gPDb As PanDb.pdbCls
Set gPDb = New PanDb.pdbCls
DestCabId = 3
Redim DocId(2)
DocId(0) = 80
DocId(1) = 121
UserId = 7
lRetVal = gPDb.PostDocument(DestCabId,DocId,UserId)
If lRetVal <> NG_SUCCESS Then
MsgBox gPDb.ErrDescription, vbInformation
Screen.MousePointer = vbNormal
Exit Sub
End If