not use sequence in auto-enter
But how do i put next sequence into new record.ordernumber
With your own code.
You can take a look at this old thread.
Since you are using Oracle you can, just as with PostgreSQL, call the next value of a sequence. So the described procedure in that thread can be much simpler for you.
var _record = arguments[0];
//only get sequence number when inkpordkrt_nr is null
if (_record.inkpordkrt_nr == null)
{
var maxReturnedRows = 1;
var query = 'select SEQ_INKPORDKRT_NR.nextval from dual';
var args = new Array();
var dataset = databaseManager.getDataSetByQuery(forms.bvko_navInkorderkaartenPrim_dtl.controller.getServerName(), query, args, maxReturnedRows);
_record.inkpordkrt_nr = dataset.getValue(1,1)
if (_record.inkpordkrt_nr != null)
{ return true; }
else
{
var thePressedButton = plugins.dialogs.showErrorDialog('Error', 'Inkooporderkaart nr niet gevuld, inkooporder wordt niet aangemaakt','OK');
databaseManager.rollbackEditedRecords()
databaseManager.rollbackTransaction()
return false;
}
}