on 08-09-2007 12:31 PM
I have a problem in my HTML/JavaScript calling an Xacute query. My business transaction gives me the expected results. My Xacute query gives me the correct results. However, when I run the HTML, I'm getting an error. The error does not display on the screen. Instead blanks display on the screen. I've been looking at it for a couple of days. I can't see the problem. Any help you could provide would be greatly appreciated.
Here's my JavaScript code:
document.get_oper_cmd.getQueryObject().setParam(1,order);
document.get_oper_cmd.getQueryObject().setParam(2,WrkCntr);
// Execute the get operations applet (DSH_GET_OPER_DET_XQRY)
document.get_oper_cmd.executeCommand();
//If there are errors
if (document.get_oper_cmd.getLastError());
//Display the error then leave
{alert(document.get_oper_cmd.getLastError());
alert("Errors")
return;
}
When it runs - I get an alert that is blank, and then an alert that has "Error" assigned to it.
Thank you for the help,
Michelle
Hi Michelle,
Are you seeing any errors in the Java Console? I would code it like this:
if(document.get_oper_cmd.executeCommand()) // if successful
alert("Success");
else
alert(document..get_oper_cmd.getLastError());
Have you alerted your order and WrkCntr variables to make sure they contain valid values?
Kind Regards,
Diana Hoppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Adarsh!!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michelle,
I'm glad you got the code working, though I think Adarsh gave a better explanation as to why yours wasn't working; I should have gone into more detail for you. It nice to see the occassional female on the forum
Kind Regards,
Diana
Thanks Adarsh!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This was answered! Thank you Diana. I used the syntax in the message, and it worked great. My problem was in the syntax.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try something like this:
I hope <b>get_oper_cmd</b> is your applet name.
document.get_oper_cmd.getQueryObject().setParam(1,order);
document.get_oper_cmd.getQueryObject().setParam(2,WrkCntr);
if ( document.get_oper_cmd.executeCommand() )
{ }
else
{
alert("Some Problem has occured" + document.get_oper_cmd.getLastError())
return;
}
the statment <b>document.get_oper_cmd.getLastError()</b>
will not return any boolean type to if statment it returns a String.
Through this you will get know where error is going on.
And you said blanks the screen. through iCommand applet you cannot display instead you need to use iGrid applet. But if you are Inserting/updating etc then use iCommand applet.
Regards,
Adarsh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.