REMOVE_OBJECT

Script Function: Deletes an existing object.

Syntax

REMOVE_OBJECT (Object Name)

Syntax

Description/Format

Object Name

Name of the object that should be deleted.
Format: script literal or script variable

REMOVE_OBJECT cannot be used to delete a folder.


Return codes

"0" - Deletion was successful.
"20645" - This object does not exist.
"20217" - This object is currently open for editing purposes.
"20369" - The object is in the Transport Case.

Comment

A deleted object is moved to the Recycle Bin and can be restored afterward.

The script statement :ON_ERROR can be used to define the reaction to errors that can subsequently be analyzed using the script functions for error handling. Depending on the specifications you have made, script processing either continues or is canceled. 

This script statement has the effect that all open transactions of the script are written to the AE database.

Example

This following example deletes the object "FIRM.CALENDAR2003".

:SET &RET# = REMOVE_OBJECT("FIRM.CALENDAR2003")

See also:

Script element Description

CREATE_OBJECT

Creates an object (Calendar, Login and Variable only).
MODIFY_OBJECT Changes an existing object (Calendar, Login and Variable only).
MOVE_OBJECT Moves an object to a folder.
:ON_ERROR Determines the reaction to certain errors and messages of script elements.

Script Elements - Handle Objects

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function