How to use openUrl to act like the built-in edit record behavior

How to use openUrl to act like the built-in edit record behavior

Hi

  i have used customer action to call forms to update records in popup window
  but i encounter some problem while closing the popup window

  if using openUrl("#Script:page.refresh", "same window")
  the view page reloaded to default setting, all search/filter are gone

  if using openUrl("#Script:page.close", "same window");
  popup window closed, but the newest update is not shown in view page

  how can i make the openUrl act just like the built-in edit record behavior?
  remain the search/filter setting, also show the latest update in view page

  thanks

regards, Matthew