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:

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

  • CREATE_OBJECT
    Creates the specified object

  • Object Type
    Short label of the object type that you want to create
    Allowed values: CALE, LOGIN or VARA

  • Object Name
    Name of the object
    Format: script literal or script variable

  • Folder
    (Optional) Name of the folder in which to create the object
    Format: script literal or script variable
    Note: If you do not specify a folder, or if the folder you specify does not exist, the object is created in <No folder>.

  • Title
    (Optional) Title of the object
    Format: script literal or script variable

  • Error Handling
    (Optional, static VARA objects only) Action to take when the VARA object does not contain a value at runtime
    Allowed values:

    • E
      Issues an error message
    • I
      Initializes the VARA object according to the type of variable (default)

  • Data Type
    (Optional, static VARA objects only) Variable type of the VARA object
    Allowed values:

    • C
      String (default)
    • F
      Number
    • T
      Timestamp

  • Validity
    (Optional, static VARA objects only) Scope of the VARA object
    More information: STATIC VARA Objects
    Allowed values:

    • *
      No scope
    • FREE
      Freely selected (default)
    • 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

Notes:

  • To create Calendar, Login or VARA objects, you need write privileges (W) for the respective object types.
  • This script statement causes all open transactions of the script to be written to the AE database. For more information, see Script Processing.
  • (VARA objects only) Default values for Error Handling, Data Type and Validity are used if you do not specify these optional parameters. For more information about the attributes of VARA objects, see User-Defined VARA Objects.

Tip: Include lines in your script to define what happens when errors occur, and to help you analyze errors. For more information, see Script Elements for Error Handling.

Return Codes

The script function has the following return 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")

See also: