INSERT-ROW fails on empty dynamic browse

-Zigo-

Member
I have created a static temp-table and a dynamic browse. By default, the browse has no records.

When I try to add a record to the browse using INSERT-ROW(), I get the error "Invalid use of browse method INSERT-ROW. There are no selected rows (382)"

Well of course there's no selected rows - it's empty! The help file and pdf files suggest "You can use the INSERT-ROW() browse method in an empty browse. It places a new row at the top of the viewport" - but it clearly doesn't work that way.

Can anyone help? I've searched these forums and only found 1 thread (from ~2 years ago) where someone had the same problem, and there was no reply. I can only assume I'm missing something obvious.
 

jongpau

Member
What Progress version are you using? In the help I have here (9.1D and 9.1E) it states
Inserts a blank line in an updateable browse before or after the last selected row. The blank line is a placeholder for a new record to be added through the browse. This method cannot be used with a read-only browse.
Since you are using a temp-table anyway, maybe you can just create a blank record in the temp-table and allow the user to update that record? After that inserting a row should work. If you have to submit the data in the temp-table to the database you can then check whether a row is an empty one or not - skip the empty row(s) and only save the complete ones (messy, I know, but it might do the trick for you).
 

-Zigo-

Member
I'm using 9.1E and the help file says the same as you quoted.

I've managed to produce a work-around. When I want to insert the initial row I create a dummy entry in the temp-table, refresh the browse, select the dummy record, insert the new row, delete the dummy record, re-refresh...but how stupid is that?
 

-Zigo-

Member
Even in devhandbook.pdf it says:
You can use the INSERT-ROW() browse method in an empty browse. It places a new row at the top of the viewport.
...which clearly is not the case.

The problem I have now is this: I add the first entry to the browse, no problem. I add the second entry...but it appears in the browse above the first entry, even though I specified INSERT-ROW("AFTER").

For most other instances of INSERT-ROW("AFTER"), an entry will be created at the end of the browse, just as I want. But even then it's not consistent - sometimes after about 6 or 7 inserts, the new entry will appear at a fairly random point in the browse. Before I do INSERT-ROW, I re-open the query and APPLY "END" to the browse, which should give me the focus on the last entry.

I have read that there are "issues" with using INSERT-ROW on updateable browses - is this one of those "issues"? I am not allowing the user to modify any entries in the browse - I am just using it to build a list of values entered elsewhere on screen.

Also, if I try to use CREATE-RESULT-LIST-ENTRY() after I've inserted the row and assigned the temp-table values, I get the error: "Selected row must be new row when using CREATE-RESULT-LIST-ENTRY for BROWSE widget. (9483)"
 
Top