deleteUser

From AgileApps Support Wiki
Revision as of 07:09, 8 February 2018 by imported>Aeric (Created page with "{{DISPLAYTITLE:deleteUser}} Delete a user. '''Syntax''' :<syntaxhighlight lang="java" enclose="div"> Result result = Functions.deleteUser(String userID); </syntaxhighlight> '''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Delete a user.

Syntax

<syntaxhighlight lang="java" enclose="div">

Result result = Functions.deleteUser(String userID); </syntaxhighlight>

Parameters

userID
The identifier of the user to delete.


Return
Result object
Example
This example calls deleteUser, assigning the returned value to an instance of Result and calling Result.getCode to assign the error code to a variable which is then conditionally checked to determine the code to execute. If the call was not successful, the code calls throwError to display an error dialog.
<syntaxhighlight lang="java" enclose="div">

String userID = ""; // Some logic to populate userID variable. Result result = Functions.deleteUser(userID); int resultCode = result.getCode(); if(resultCode < 0) {

   // Some error happened.
   String msg = "User could not be deleted";
   Logger.info(msg + ":\n" + result.getMessage(), "Delete");  // Log details
   Functions.throwError(msg + ".");                     // Error message

} else {

   // Take other actions on successful addition
   // of the user.

} </syntaxhighlight>