DeleteAccount

Security Manager Module

Description Removes an account.
Returns Object value
Usage Script Only.
Related to: AddAccount | ModifyAccount
Format

\SecurityManager\DeleteAccount (NewAccountData [, PtrReturnCode, HaveLock]);

Parameters  
NewAccountData
Required. An AccountData structure, a single dimension array of AccountData structures or a dictionary of AccountData structures identifying the account(s) to delete.
PtrReturnCode
Optional. A pointer to a value that will contain one of the defined result codes at the conclusion of the operation.
HaveLock
Optional. A Boolean value that indicates whether the working copy lock is held by the calling code. Default FALSE.
Comments

To use this API, the calling code must be running in a security session that has Manager privilege.
Deleting an account is an asynchronous operation. If the asynchronous operation was not attempted, due to detection of an error, the return value will be Invalid. If the asynchronous operation is attempted, the return value will be an object value. The object value will become Invalid when the asynchronous operation completes. At that time (or when the method returns Invalid), the value addressed by PtrReturnCode can be examined to determine the status of the operation. The contents of the value addressed by PtrReturnCode is undefined until the method returns Invalid.

A single account can be deleted by supplying a single AccountData structure in NewAccountData. Multiple accounts can be deleted in one operation by providing a single dimension array or dictionary of AccountData structures in NewAccountData.

The result code returned in the value addressed by PtrReturnCode will be a scalar value if a single structure was supplied in NewAccountData. If an array of structures or a dictionary of structures was supplied, a single dimension array of the same size as NewAccountData will be returned in the value addressed by PtrReturnCode, each element containing the result code for the corresponding NewAccountData element.

Deleting an account requires a working copy write lock. If such a lock is held by the calling code, the HaveLock parameter must be set to TRUE. Otherwise omit this parameter or set it to FALSE. If the calling code holds a read lock on the working copy, this must be released before DeleteAccount can complete its operation.

The AccountData structure(s) provided must have the AccountID member set to an existing account ID. All other members are ignored.