When trying to delete a USER who is still logged on or has active objects on Process Monitoring the following errors are shown respectively:
However, whenever trying to delete the same user with REMOVE_OBJECT function call from a regular SCRI object, the function succeeds to delete it:
:SET &RESULT# = REMOVE_OBJECT('USERNAME/DEPT')
:P &RESULT#
Execution report shows success:
2022-07-11 15:16:06 - U00020646 User ('USERNAME/DEPT') removed object 'USERNAME/DEPT' via script.
2022-07-11 15:16:06 - U00020408 0000000000000000
From the documentation, the following results are possible:
"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.
but there is no check as expected for active sessions or active tasks. Is this as designed?
Release : 12.x, 21.x
This is as designed as there are no "special" checks for user objects when using REMOVE_OBJECT, they are treated as any other objects.
This behavior is as designed. With any object being deleted with the REMOVE_OBJECT function, the checks are the same and fairly limited, although that limit works well and is understandable for >90% of the objects that can be removed with this function:
These are exactly the same checks that are used for removing USER objects. There is no check through the script to see if they're logged in or running any tasks at the time. The documentation will be updated to include the following note:
Do not use REMOVE_OBJECT for removing Users, as this function does not check if there are active tasks from the User.
The AWI should only be used for this.
If the REMOVE_OBJECT script is used, there can be downstream issues where if a user is removed while they have active schedules, the objects within can show "Fault Other - Start impossible. Other error." This may also show an access denied.