Hi All,
I am having some problem with Javascript. I need to generate sequence number based on document number generated
i.e., for doc. no 5091 my tabular form should generate sequence number 1,2,3... when i hit Add row button.
For which I opt for going to Javascript. So I put a button called TEST as you can see in the below pic.
Now I created a dynamic action "test_da" for button test
My True Action is...

The above code i used is
{
apex.widget.tabular.addRow();
}
var last_rownum = $('input[name="f04"]').closest('tbody tr:nth-last-child(1)').children('td').children('input[name="f04"]').val();
var next_rownum = 0;
if(last_rownum == ''){last_rownum = 0};
next_rownum = Number(last_rownum) + 1;
if(last_rownum == ''){last_rownum = 0};
$('input[name="f04"]').closest('tbody tr:nth-last-child(1)').children('td').children('input[name="f04"]').val(next_rownum);
The above code inserts a new row but the sequence number is not incremented. (See my first picture)
I also need to check that current row is saved before adding next row.
Any Help greatly appreciated.
Regards,
Soofi