ObjectExists

You can use the ObjectExists function to check if an object key exists for a specified symbol. This function verifies if an object with the specified object key exists in the system before performing operations on it.

When to use

You can use this function to:

  • Check if an object key exists for a specified object symbol.
  • Use workflow logic that depends on the existence of an object.
  • Check whether an object exists before creating a new object to avoid duplicates.

Syntax

int ObjectExists(string objKey, string objSymbol)

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 one (1) if the object exists and zero (0) if the object does not exist.

Prerequisites

  • No special permissions are required for the existence check.
  • The function works regardless of the object lock status.

Examples

Example 1
int iExists = ObjectExists("PIZZASAUCE\003", "FORMULA");
Example 2
int iExists = ObjectExists("OLIVE_OIL", "ITEM");
Example 3
int iExists = ObjectExists("", "");