Sample Code (C#)
public void changeEmailFunc()
{
NetSuiteService service = new NetSuiteService();
LoginClass passport = new LoginClass();//User Defined/Created Class to hold login credential
service.passport = passport.login();
ChangeEmail changeEmail = new ChangeEmail();
changeEmail.currentPassword = "xxxxxx";
changeEmail.newEmail = " test@email.com ";
changeEmail.newEmail2 = " test@email.com";
changeEmail.justThisAccount = true;
SessionResponse response = service.changeEmail(changeEmail);
if (response.status.isSuccess)
{
Console.WriteLine("Email have been Successful Changed");
}
else
{
StatusDetail[] statusDetail = response.status.statusDetail;
for (var x = 0; x < response.status.statusDetail.Length; x++)
{
Console.WriteLine(statusDetail[x].code);
Console.WriteLine(statusDetail[x].type + ": " +statusDetail[x].message);
}
}
Console.ReadLine();
No comments:
Post a Comment