Auto Sequence/ Serial Number Assign to Column in IG - Oracle Apex
Auto (Sequence) Serial Number Assign to Column in IG - Oracle Apex
1) Function and Global Variable Declaration
function UpdateSrno()
{
apex.region("GRVDTLID").widget().interactiveGrid("getActions").set("edit", true);
apex.region("GRVDTLID").widget().interactiveGrid("getViews", "grid").view$.grid("selectAll");
var widget = apex.region("GRVDTLID").widget();
var grid = widget.interactiveGrid("getCurrentView");
var model = grid.model;
var selectedRecords = grid.getSelectedRecords();
var i =1;
if ( grid.supports.edit )
{
model.forEach(function(record, index, id)
{
meta = model.getRecordMetadata(id);
if (!meta.deleted)
{
sr = model.getValue(record,"SRNO");
model.setValue(record,"SRNO", (i).toString());
i++;
}
}); }}
2) Call the function on Button or URL before Save action
javascript:UpdateSrno();apex.confirm(htmldb_edit_message,'SAVE');
1) Function and Global Variable Declaration
function UpdateSrno()
{
apex.region("GRVDTLID").widget().interactiveGrid("getActions").set("edit", true);
apex.region("GRVDTLID").widget().interactiveGrid("getViews", "grid").view$.grid("selectAll");
var widget = apex.region("GRVDTLID").widget();
var grid = widget.interactiveGrid("getCurrentView");
var model = grid.model;
var selectedRecords = grid.getSelectedRecords();
var i =1;
if ( grid.supports.edit )
{
model.forEach(function(record, index, id)
{
meta = model.getRecordMetadata(id);
if (!meta.deleted)
{
sr = model.getValue(record,"SRNO");
model.setValue(record,"SRNO", (i).toString());
i++;
}
}); }}
2) Call the function on Button or URL before Save action
javascript:UpdateSrno();apex.confirm(htmldb_edit_message,'SAVE');
Comments
Post a Comment