Sc_redir back to main menu double the bar

Hi all,
I’m in a standard form and I added a php button as “Previous” in order to come back to main menu.
sc_redir(menu);
When the form close and the menu appears it’s doubled into two identical bars.
How can I fix this weird beavior ? I used also _parent and _blank but nothing changes.

are you using secruity module?

Absolutely not.
From main menu I open a form and when you come back to main menu from it I use sc_redir(menu). Nothing more

are you using this form for update or insert data?

You can do it in serval ways:

In the link propperties, you can activate “Close form after insert” and “Close form after update”

Other way, in the form in the OnAfterUpdate or OnAfterInsert or OnAfterDelete event, you should use sc_exit©;

Ok you are right but I want user has the button to come back to main menu. I use it every where and this is only a sample.
Is there a way to make the menu app closes when you go to a form ? In this moment the menu, as it would be normally, remain available on top of screen also when you are working on the form. That would be the working of a normal system with menu on top or on side always open and available to users.

maybe you can do it with a blank site… redir to a blank, and from the blank you can redir to your main…

I do it in my menu all with tabs… and open forms in modal normaly… how do you work in you menu?

I thought _parent would work in this situation… Have you tried the ‘_top’ parameter?

Hello,
have you try ‘_self’

Hello and thanks for suggestions
See video to understand better the issue

No way also using “_self”

I do something similar. I use a global variable to load a different default application selected by the user. I have that same application on a menu item called “home”. When the user clicks the “home” option it closes whatever they are working on and reloads the default application. To make this work, I use this:

sc_redir(app_menu,’ ‘,’_parent’) ;

1 Like

Notice the difference in bhardins code…

there is an additional comma before the _parent parameter.

the macro is sc_redir(appname, parameters, target)

Even if you don’t pass a parameter, the target needs to be the third parameter, so i/she pass a blank parameter in the middle… hence the (appname, ‘’, ‘_parent’)