Page 1 of 1

Returned SQL select value into subj_num field

PostPosted: Wed Sep 01, 2004 8:12 pm
by akalehzan
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

PostPosted: Wed Sep 01, 2004 8:18 pm
by bcusick
Create an aggregate field to get the max id, then on the table where you want the number auto incremented go into dataproviders dialog and click the column and then the "properties" button. Make the result of the calculation.

Bob Cusick

Returned SQL select value into subj_num field

PostPosted: Wed Sep 01, 2004 11:02 pm
by akalehzan
Bob,

That did it!!

By the way the two days training in Scottsdale Arizona was very helpful.

Thank you very much,

Abrahim