Returned SQL select value into subj_num field
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Hi all,
I'm trying to insert the SQL script return value into a Subj_num field with the following method:
if ( subj_num == null && "controller.newRecord();" )
{
maxRows = 1;
//find the MAX subj_num and add 1
var query = "SELECT MAX(Subj_num) + 1 FROM ID";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(),query, null, maxRows);
globals.tx30 = '<html>'+dataset.getAsHTML() + '</html>'
}
I like to insert the returned value in to subj_num field which prosperities is not HTML, it is Number.
Or is there way to do the above SQL in JavaScript?
Thanks in advance,
Abrahim
I'm trying to insert the SQL script return value into a Subj_num field with the following method:
if ( subj_num == null && "controller.newRecord();" )
{
maxRows = 1;
//find the MAX subj_num and add 1
var query = "SELECT MAX(Subj_num) + 1 FROM ID";
var dataset = databaseManager.getDataSetByQuery(controller.getServerName(),query, null, maxRows);
globals.tx30 = '<html>'+dataset.getAsHTML() + '</html>'
}
I like to insert the returned value in to subj_num field which prosperities is not HTML, it is Number.
Or is there way to do the above SQL in JavaScript?
Thanks in advance,
Abrahim