display only the record in the grid based on the form submitted

Hi,

I have a form and a grid.

​In the form, under event onAfterInsert and onAfterUpdate, I will sc_redir(grid1) back to the grid.

​My issue is that it will always redirect back to the 1st record from the database. Then I have to manually navigate to the particular record.

​I need after submitting the form, the grid will directly display only the record that I have submitted from the form.

Can anyone kindly help?

Thanks.

In addition to my first query, I also require that when the grid application is selected by the user, it will not display any record first.
​Only after insert new record, that particular record will be shown.

One workaround for your first request is to add to the grid SQL select an “order by id-field desc”.
That’s assuming you have a numeric autoincrement id-field field n your table. And that you don’t need a different sorting.
The grid will still show all records but the first on top will be the last inserted one.

Maybe you can investigate if a single multi record form app can give you the behavior you’re looking for.

You could also use a “where id-field = [idparam]” in the SQL statement of the grid app.
So that you can sc_redir(grid1,idparam={id-field}) from the form app.
This way the grid will only show one record.

[LEFT][SIZE=13px]Hi,[/SIZE][/LEFT]

[LEFT][SIZE=13px]Thanks.[/SIZE][/LEFT]
[LEFT][SIZE=13px]​The 2nd method works fine. It will only shows the last record after submitted the form.[/SIZE][/LEFT]
[LEFT][SIZE=13px]​I also tried linking the application in form to the grid and pass the id parameter to the grid which also works.[/SIZE][/LEFT]

[LEFT][SIZE=13px]​Is it possible that if user navigate away from the grid application or logout for example, when the user come back to the grid application it will display blank record?[/SIZE][/LEFT]