Sunday, June 2, 2019

Web Services (SuiteTalk) : PHP Toolkit 2012.2 and above > Change Password

Use the changePassword operation to change a user's password. Below is a sample code demonstration how to change password using PHP Toolkit 2012.2 and above.

Sample Code (PHP Toolkit 2012.2 and above)

$service = new NetSuiteService();$changePassword = new ChangePassword;$changePassword->currentPassword = "xxxxxx";$changePassword->newPassword = "yyyyyy";$changePassword->newPassword2 = "yyyyyy";$changePassword->justThisAccount = true;$changePasswordRequest = new ChangePasswordRequest();$changePasswordRequest->changePassword = $changePassword;$response = $service->changePassword($changePasswordRequest);if($response->sessionResponse->status->isSuccess){ echo "Your Password has been Successfully CHANGED";}else{ $statusDetails = $response->sessionResponse->status->statusDetail; foreach($statusDetails as $statusDetail) { echo $statusDetail->code; echo $statusDetail->type .": " . $statusDetail->message; }}

No comments:

Post a Comment