Reload or refresh grid after modal window

Hello,

I have always this problem.
I don’t hnow how to do this.
I have a grid in master/detail, and i add a button to call a modal form. After update or add, i would like to refresh the parent grid.
I tried a lot of code with sc_exit, script reload, but noway

Someone to help me ?
Thanks
Guy
V9.6.006

The parent grid of the modal is the detail app

From the modal in onAfterInsert or onAfterUpdate you can do

echo "<script>
parent.location.reload();
</script>";

If it’s the master app that you want to update you should be able to do

echo "<script>
parent.parent.location.reload();
</script>";

I don’t have your code in front of me so I’m not sure if this will work or if it has to be tweak a little bit

1 Like

I have already used this code but i have a request in return (in french)


and reload applied for the master/detail complete not only for my detail. i have some tabs with differents details.

May be i’m not clear ?
Guy

Basically it’s working, it’s your browser that is giving you a warning about reloading, same thing will when you press F5 or click refresh

Can you try it on Edge or Chrome just to confirm if it’s working or not, so you know if you are on the right track

You can also try to do a sc_redir to the master app

This should work

parent.location = parent.location.href;

or

parent.location = parent.location.protocol +’//’+ parent.location.host + parent.location.pathname;

i confirm with chrome, no ask BUT it return on the first tab of my form not the tab actually in use

It’s going back to the wrong parent, need to check the HTML to find the right parent

maybe use window.location instead of parent.location

always a request to resend data.
Nevermind, i try to found an other work around
Thanks
Guy

i tried these options but it does not seem to work, i am using a modal form that UPDATES a record in the grid. the modal form gets opened through an actionbar link. i want to refresh the grid after i update the record. any help would be greatly appreciated.