Hello,
I am creating a Business Central extension that has a page with a repeater. The page has a source table and SourceTableTemporary is set to true. The logic on the page inserts new items in the temporary table and the repeater is supposed to list them.
One of the problems is that once I insert one record, all subsequent inserts will throw an exception for a duplicate primary key. My key is an integer so I fixed this by adding an increment to the primary key (note that the primary key on the table is defined with AutoIncrement).
"No." := Count() + 1;
- Insert an item in the temp table and it shows on the first line in the repeater.
- Select the second line of the repeater, which is blank.
- Insert a second item in the temp table and it shows in the second line of the repeater.
- Insert a third item while the second line is selected and the second item in the repeater get replaced by the third item.
How can I move the selected repeater line to the next blank line after a record is inserted? My goal is to allow a user to enter data press enter and add items to a list.