SetAsLatestVersion

Sets the specified version of document as the latest  version of document.

Public Function SetAsLatestVersion(ByVal DocumentId As Long, ByVal VersionNo As Single, ByVal VersionComment As String) As Long

 

Parameters

In/out

Name

Data type

Description

In

 

DocumentId

Long

Index of the Document of which version has to be set

In

VersionNo

Single

Version No of of the document which we want to set as latest

In

VersionComment

String

Fixed string to be set as comment for the newly created version

 

Description

This function is called in both local and shared cabinet. 'VersionNo' parameter indicates the  version of  the  document  which we want to make as latest version . Version comment parameter is a string . This function creates a new version of the document with same image as the version passed and set this new created version as latest.

 

Return value

Name

Description

 1

In case of success

-1

Invalid cabinet name

-2

Local cabinet is read only

-3

Cabinet not connected

-201

Insufficient rights for the current operation

-133

User not logged in

 

Example

    Dim lRetVal                      As Long

    Dim lDocId                       As Long

    Dim slVersionNo               As Single

    Dim sVersionComment      As String

    Dim gPDb                        As PanDb.pdbCls


    Set gPDb = New PanDb.pdbCls

    lDocId = 5

    slVersionNo = 1.4

    sVersionComment = " Version No:1.1 set as latest "

    lRetVal = gPDb.SetAsLatestVersion(lDocId, slVersionNo, sVersionComment)

    If lRetVal = 1 Then

        MsgBox "Success"

    Else

        MsgBox gPDb.ErrDescription

    End If