DEACTIVATE_UC_OBJECT

Use the DEACTIVATE_UC_OBJECT script function to deactivate a completed task. The function lets you deactivate tasks that have already ended:

Notes:

Tip: You can define settings in executable objects to automatically deactivate the task. For more information, see Automatic Deactivation Section.

Syntax

DEACTIVATE_UC_OBJECT (RunID [,FORCED])

Parameters

Return Codes

The script function returns the following codes:

Example

The following example activates an object, and waits for the task to complete. If an error occurs, the system sends an email to a user. If the task completes without an error, the script deactivates the task.

:SET &ACTOBJ# = ACTIVATE_UC_OBJECT(&OBJ#,WAIT)

:
IF &ACTOBJ# = "0"
:   
SET &ERRNR# = SYS_LAST_ERR_NR()
:   
SET &ERRINS#  = SYS_LAST_ERR_INS()
:   
SET &MESSAGE# = GET_MSG_TXT(&ERRNR#,&ERRINS#)
:   
SET &RET# = SEND_MAIL("John.Smith@automic.com",,&MESSAGE#, "Please check. Thanks!")
:ELSE
: SET &DEACTJOB# = DEACTIVATE_UC_OBJECT(&ACTJOB#)
:
ENDIF

See also:

seealso

Script Elements for Handling Tasks