Hi,
I try to do an error trap, when something classified as error happen, I invoke event.owner.adderrormessage, but the if after that error message displayed, then the user doing the allowable did, still that error come up.
What should I do to prevent that to happen?
error trapping...
Moderators: Jon, Steve, Ian, Dave
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
Here is the code:
The function below will try to add a new user and if the email registered is already exists it will trigger the error message. The problem is, even if the email is change to an absolutely new (never registered) email address, still the it assumed already exists.
The function below will try to add a new user and if the email registered is already exists it will trigger the error message. The problem is, even if the email is change to an absolutely new (never registered) email address, still the it assumed already exists.
Code: Select all
function RegisterNewUser()
{
var lSuccess = true;
var newReg = system.sequenceManager.sequence('APPLICANT');
tables.APPLICANTUSER.insertRow();
tables.APPLICANTUSER.EMAILADDRESS.value = fields.emailAddress.value;
tables.APPLICANTUSER.REALNAME.value = fields.RealName.value;
tables.APPLICANTUSER.PASSWORD.value = Transpose(fields.Password.value.trim());
tables.APPLICANTUSER.APPLICANTID.value = newReg;
try
{
tables.APPLICANTUSER.updateTable();
}
catch (ex)
{
lSuccess = false;
controls.msgPanel.hidden = false;
if (ex.javaException instanceof com.ebasetech.xi.exceptions.FormRuntimeException)
event.owner.addErrorMessage("Email address: " + fields.emailAddress.value + " is already registered!")
else
event.owner.addErrorMessage(ex.message);
}
if (lSuccess)
{
SendConfirmationLink(newReg);
}
else
{
event.owner.addErrorMessage("Unknown problem happen that prevent your data entered to the system.")
}
}
[/code]Jon wrote:If you still get the error message, it means the error is still being generated by the script. It sounds like there's something wrong with your code, could you add it to this post.
0 x
-
- Moderator
- Posts: 1342
- Joined: Wed Sep 12, 2007 12:49 pm
-
- Ebase User
- Posts: 305
- Joined: Thu Jul 02, 2015 8:32 am
- Location: Indonesia
Who is online
Users browsing this forum: No registered users and 15 guests