IsLockedBy

You can use this function for Optiva Workflows.

Purpose

The function IsLockedBy checks if an object is locked and returns the user who locked it.

Syntax


string IsLockedBy(string objSymbol, string objKey)

Return Value

If the code is successful and the object is not locked a value zero (0) is displayed or else returns to the USER ID who checked if it is locked.

Arguments

Part Description
objSymbol The object type or current object type of the data.
Note: Use empty quotation marks to indicate the current symbol of the workflow.
objkey The object key or current object key of the data.
Note: Use empty quotation marks to indicate the current object of the workflow.

It returns a value of 0 or user ID.

Value Description
0 Returns 0 if the object is not locked.
user ID Returns the ID of the user who checked it out if it is locked.

Examples

This example determines the user who has checked out the current object from which the Workflow was launched.


Dim rc As String = IsLockedBy()
If rc Is Nothing Then
MessageList(_OBJECTSYMBOL & " " & _OBJECTKEY & " not checked out.")
Else
MessageList(_OBJECTSYMBOL & " " & _OBJECTKEY & " checked out by" & rc)
End if

This example determines if a specific object has been checked out and if so by whom.


Dim rc As String = IsLockedBy("FORMULA", "FS-0010\0001")
If rc Is Nothing Then
MessageList( "Formula FS-0010\0001 is not checked out.")
Else
MessageList("Formula FS-0010\0001 is checked out by" & rc)
End if

This example determines if the formula FS-0010\0001 has been checked out and returns the user if the object is locked.

String lockedByUser = IsLockedBy("FORMULA", "FS-0010\0001");

This example determines the user who has checked out the current object from which the Workflow is launched.

String lockedByUser = IsLockedBy();