For a proof of concept I have a form with table and a button on top of it. The button have the following code in OnClick event.
if ( BO.F_TableHistory.getLength() === 0 ){
var rowid = 1;
}
else {
var lastrow = BO.F_TableHistory.get( BO.F_TableHistory.getLength() - 1 );
var colid = lastrow.getChildren();
var rowid = Number(colid.get(0).getValue()) + 1;
}
var newRow = BO.F_TableHistory.createNew();
var newCol = newRow.getChildren();
var dateNow = new Date();
newCol.get(0).setValue(rowid); //Request ID
newCol.get(1).setValue(dateNow); //Timestamp
newCol.get(2).setValue(app.getCurrentUserDisplayName()); //Updated By
newCol.get(3).setValue('Update'); //Action
//Add new table row
BO.F_TableHistory.add(newRow);
If I launch the form and click the button I can see rows added to the table. But when I click Save / Submit and go back to open the document, the table is empty. Both Save and Submit are default Stage action button with nothing specified on it. Do I need to add anything to actually those rows that I just inserted ?
Tinus Riyanto - Prisma Global Solusi