IsLocked
You can use this function for Optiva Workflows.
Purpose
The function IsLocked, determines if an object is locked (i.e., checked out).
Syntax
int IsLocked(string objSymbol, string objKey);
Return Value
If the code is successful and the object is locked a value one (1) is displayed, zero (0) if the object is not locked.
Description
IsLocked checks the locked (i.e., checked out) status of a formula.
| 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 1.
| Value | Description |
|---|---|
| 0 | Returns 0 if the object is not locked. |
| 1 | Returns 1 if the object is locked. |
Use CheckIn or CheckOut depending on the return value.
Note: You can override security and change a locked formula using Workflow. Use discretion when overriding security.
Examples
This example determines if the current object from which the Workflow was launched has been locked (i.e., checked out).
Dim rc As Integer = IsLocked()
If rc = 1 Then
MessageList(_OBJECTSYMBOL & " " & _OBJECTKEY & " is locked.")
Else
MessageList(_OBJECTSYMBOL & " " & _OBJECTKEY & " not locked.")
End if
This example determines if a specific object has been locked (i.e., checked out).
Dim rc As Integer = IsLocked("FORMULA", "FS-0010\0001")
If rc = 1 Then
MessageList( "Formula FS-0010\0001 is currently checked out.")
Else
MessageList("Formula FS-0010\0001 is not checked out.")
End if
IsLocked("FORMULA", "FS-0010\0001");
Note: You can override security and change a locked formula using Workflow.