Skip to Content
avatar image
Former Member

HTML - Business Transaction - Xacute Query

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 09, 2007 at 12:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 09, 2007 at 01:18 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2007 at 12:18 PM

    This was answered! Thank you Diana. I used the syntax in the message, and it worked great. My problem was in the syntax.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2007 at 12:34 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 10, 2007 at 12:56 PM

    Thank you Adarsh!!!!

    Add comment
    10|10000 characters needed characters exceeded