CheckOut
You can use the CheckOut function to unlock an Optiva object for editing by the current user.
Once checked out, the object can be modified by the user who performed the checkout, while remaining is locked (read-only) for all other users.
When to use
You can use this function:
- If you need to modify or edit an Optiva object.
- To claim ownership of an object for a specific work session.
When not to use
You cannot use this function if:
- You only need to read or view object data without modifications.
- The objects checked out by another user. (will fail without administrative override).
Syntax
int CheckOut(string objSymbol, string objKey)
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| objSymbol | string | Optional |
The symbol of the object.
Note: You can use empty quotation marks ("") for the current workflow symbol.
|
| objKey | string | Optional |
The key of the object.
Note: You can use empty quotation marks ("") for the current workflow symbol.
|
Return Value
A value one (1) is returned if the object is checked out and zero (0) if not checked out.
Prerequisites
- The user must have checkout permissions for the specified object type.
- The object must exist and be accessible to the user.
Examples
- Example 1
-
Check Out Specific Formula
int rc = CheckOut("FORMULA", "FS-0010\0001"); if (rc == 1) MessageList($"{_OBJECTSYMBOL} {_OBJECTKEY} checked out."); else MessageList($"{_OBJECTSYMBOL} {_OBJECTKEY} not checked out.");
- Description
- Unlocks the formula "FS-0010\0001" for editing by the current user. Other users cannot modify it.
- Example 2
-
Check Out Current Workflow Object
int rc = CheckOut("", ""); if (rc == 1) MessageList($"{_OBJECTSYMBOL} {_OBJECTKEY} checked out."); else MessageList($"{_OBJECTSYMBOL} {_OBJECTKEY} not checked out.");
- Description
- The object upon which the workflow is launched is unlocked (uses current workflow context).