Correct way to set selected record in a browse immediately after the window is opened?

What is the correct way to set selected record in a browse immediately after the browse window is opened?

The Id (Primary key) of the record that should initially be selected is passet to the Browseprocedure as a parameter…

I struggling a bit to get this to work properly so I hope someone can help :slight_smile:

Thanks :slight_smile:

André Teig
[email protected]

Are you using ABC or Legacy templates?

We are using ABC.
André

You should be able to use BRW1.StartAtCurrent = YourParameter >

(You might have to pass YourParameter to a local variable in a routine before you do this???)

EDIT: What Rick says in the next post is the correct way of using StartAtCurrent. Sorry for the misinformation.

1 Like

Use the passed ID to Fetch the record in the window manager Init method after the tables are open.
The set the browse StartAtCurrent = true after the browse INIT call, also in the window manager Init method.

2 Likes

Thank you very much for your answer :slight_smile:

Depending on your requirements: If you already have the record fetched, and you’re looking to use the browse as a selector, you don’t have to do anything in the browse procedure itself.

Just set GlobalRequest.

GlobalRequest = SelectRecord
MyBrowseProc() ! Should automatically select the record
IF GlobalResponse = RequestCompleted
  RespondToNewSelection()
END
1 Like