cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve Query Results in Javascript

Former Member
0 Kudos

Hi,

I've created a SQL query template with Param.1. I've created and iCommand for it. I've also created an Applet consisting of the SQL Query and iCommand template.

I am trying to retrieve query results after setting the parameter. I am getting errors (undefined of course) when using the getValue() method.

1. var commandObject = document.AppName.queryobject;

2. commandObject.setParam(1, var1). var1 = 'Training'

3 applet refresh

4. var var2 = commandObject.getValue(1,1) ==> crashes.

5. alert (var2);

This seems pretty straight forward. Any ideas?

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

kelly

Just missing one javascript code <b>iCommand.executeCommand();</b>

1. document.AppName.getqueryobject().setParam(1, var1) ;

2. document.AppName.executeCommand();

3. var var2 = document.AppName.getValueByName(String ColName, 1);

5. alert (var2);

Regards

Som

Answers (1)

Answers (1)

Former Member
0 Kudos

There is no "refresh" for a command...there is an executeCommand() method, and be sure to check the return status for this call prior to calling getValue().