grid returns to page 1 after save

When I edit a record from a grid I expect the form to return to the grid page I came from after I click “Save” but no matter what page I come from I am always returned to Page 1.

Is there a way to set the form to return to the grid page that contains the record I just edited?

If I’ve understood…
sc_redir(name_of_form;"_parent")

[QUOTE=giovannino;30687]If I’ve understood…
sc_redir(name_of_form;"_parent")[/QUOTE]

Ok, thank you. Do you have to do this with all of your forms or are you happy that the form returns to the wrong grid page?

sc_redir(name_of_application;"_parent")

name_of_application is the application where you want to come back . Form, Grid, Control… etc etc

Have a look also to sc_exit(parameters) that it would be enough in many cases

I suppose I am also asking if what is happening to me is normal behaviour.

Go to any page (other than the first page) of a grid. Let’s say page 3.
Click the pencil to edit a record.
Click “Save” on the record form and you are returned to page 1 of the grid.

I am saying that this should not happen (out of the box). I am saying that after editing the record and saving it, you should be returned (in this instance) to page 3 of the grid.

Can anyone confirm that this is sc default or have I missed a setting somewhere?

Yes, you are seeing the “expected” behavior. I do not like it either. The problem is that sc apps are stateless, so the grid does not know “where you are coming from”. What we really are talking about is the “selection” that the grid is displaying. The grid acts the same whether it is being called from a menu or from an exiting form.

What I really would like to see is a “call stack” that preserves selection (and other state information), such that when exiting an app, the “previous” app gets displayed in exactly the same state as it was in before.

I do this now, thru code, however it takes a lot of globals to accomplish it. Within the Grid app you have to track the selection, sort, and any other state info that you will need later. At the application init time, you have to see of those are already set in which case you are “returning”, not “launching” and put everything back the way it needs to be.

Hope this make some sense.

Dave