CREATE_OBJECT

Use the CREATE_OBJECT script function to create objects. The function lets you specify the object type, name of the object and folder in which to create the object. You can create the following types of objects with this script function: Calendars (CALE), Login (LOGIN), and STATIC VARA Objects.

Syntax

Calendar and Login objects:

CREATE_OBJECT (Object Type, Object Name, [Folder], [Title])

Static VARA objects:

CREATE_OBJECT (Object Type, Object Name, [Folder], [Title], [Error Handling], [Data Type], [Validity])

Parameters

Parameter Description Format Allowed Values Default Value
Object Type Short label of the object type that you want to create. Script literal
  • CALE
  • LOGIN
  • VARA
n.a.
Object Name Name of the object. Script literal or script variable n.a. n.a.
Folder (Optional) Name of the folder in which to create the object. Script literal or script variable n.a. <No folder>
Title (Optional) Title of the object. Script literal or script variable n.a. n.a.
Error Handling (Optional, static VARA objects only) Action to take when the VARA object does not contain a value at runtime. Script literal
  • E: Issues an error message
  • I: Initializes the VARA object according to the type of variable
I
Data Type (Optional, static VARA objects only) Variable type of the VARA object. Script literal
  • C: String
  • F: Number
  • T: Timestamp
C
Validity (Optional, static VARA objects only) Scope of the VARA object. Script literal
  • *: No scope
  • FREE: Freely selected
  • HON: Host - each Host name
  • JBN: Job - each Job name
  • JPN: Workflow - each Workflow name
  • JPS: Workflow session - each Workflow activation
  • USN: User - each user name
  • USS: User session - each user session
FREE

Important Considerations

Key considerations include:

  • To create Calendar, Login or VARA objects, you need write privileges (W) for the respective object types.
  • This script element writes all open transactions of the script to the AE database.
  • If you do not specify a folder, or if the folder you specify does not exist, the object is created in <No folder>.
  • (VARA objects only) Default values for Error Handling, Data Type and Validity are used if you do not specify these optional parameters.

Tip: Include lines in your script to define what happens when errors occur, and to help you analyze errors.

Return Codes

The CREATE_OBJECT function returns the following codes:

  • 0: The object was created successfully.
  • 20644: An object with the specified name already exists.
  • 20710: The object name contains invalid characters.

Examples

The following example creates a Calendar object that is called FIRM.CALENDAR2020 in <No folder>:

: SET &RET# = CREATE_OBJECT ("CALE", "FIRM.CALENDAR2020" ,, "Company calendar for 2020")

The following example creates a Login object that is called LOGIN.SMITH in <No Folder>:

: SET &RET# = CREATE_OBJECT ("LOGIN", "LOGIN.SMITH" ,, "Standard Logins")

The following example creates a Login object in a folder that is called LOGIN_DIR:

: SET &NEW# = CREATE_OBJECT ("LOGIN", "LOGIN.SMITH", "LOGIN_DIR" ,)

The following example creates a VARA object for storing the retrieved number of files:

: SET &RET# = CREATE_OBJECT ("VARA", "OUTPUT.WEBHELP.VARA", "VARIABLE/STATS", "Number of Help Files", "I", "F", "FREE")

Related Topics

See also: