ObjectDelete

You can use the ObjectDelete function to logically delete a specified Optiva object from the system.

When to use

You can use this function to remove obsolete or test objects from lookups, searches, and user access.

When not to use

You cannot use this function when:

  • The object needs to be archived rather than deleted.
  • Deleting the object would violate data retention policies.

Syntax

long ObjectDelete(string objectSymbol, string objectKey)

Parameters

Parameter Type Required Description
objSymbol string Yes

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objKey string Yes

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.

Return Value

The application returns a value zero (0) if the operation is successful and a negative (-ve) value if the operation fails.

Impacts

  • The object becomes immediately unavailable to all users.
  • The object can be restored by using a workflow or through database access.

Prerequisites

You can use this function to delete an object even when the current user does not have security access to the object.

Examples

Example 1
long rtnDel = ObjectDelete("ITEM", "T0001");
Example 2
long rtnDel = ObjectDelete("", "");