I'm a newbie developer here
I have this custom table that I created and it has a Line No. Column as my primary key and also for identifier purposes.
I have this custom code that I created its very simple, yet I have this kind of problem encountered. hope you guys can help me with this one. (See attached Images) by the way. "Line No." located at Test BF table
Answers
You need to init the record each time you want to create a new record. (so inside the loop)
(also would suggest to reserve the name 'Line No.' for real Nav like Line No.'s, but that is off topic)
Good luck.
Write recTestBF.INIT; Just after the Repeat Statement.
It will work.
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/
you actually need to explicitly set "Line No." to 0 each iteration of the loop. You can do this using CLEAR or using assignment.
INSERT sets the "Line No." field to the value autoincrement generated.
INIT does not clear it again, because it does not initialize primary key fields.
If "Line No." does have any value other than 0 on calling INSERT, autoincrement is not used but the value given is used instead (and autoincrement uses this as it's new value to increment from).