Selecting created record

Hi,

maybe it is a stupid question, but how to make that when new record is inserted it is selected in browse?

I have tried to see code created by app wizard, but it did not help. When it is clicked on insert button it is called ThisWindow.Update(), and in there is only PARENT.Update.

Is the row inserted by a regular Form? If so, it should be selected automatically when you return to the browse.
If you are inserting the row manually in code, the try calling the browse class ResetFromAsk method. You’ll need to declare local variables to pass as parameters because the method prototype is *BYTE, unfortunately.

Yes it is Form selected in Templates. Do i need to call something in Form procedure?

Also ResetFromAsk does not work. It returns to top of the list. I suspect that there is something more to do in Form so that this can work.

Have long wondered why this was done. Adding a new method with passed variable values has worked fine for me over the years. For peace of mind, I’d enjoy hearing what I’ve long overlooked.

1 Like

Totally agree. I have my own browse class that I used everywhere that has a DoResetFromAsk method that is prototyped with just BYTE. It calls the under lying ResetFromAsk. I didn’t want to get into that much detail for @blue and just provide an answer to the question :slight_smile:

Understood. DAB and his team were not frivolous in the classes, so always wondered if my simple mind was just missing something obvious.

I can see no valid reason for using *BYTE in this case. Especially, since there are equates (InsertRecord, RequestCompleted, etc.) for every value you would pass to the method. Makes no sense!

ABC needs one thing that doesn’t make sense, so this is that one thing.