close application menu

Hello,

I’m trying to close application menu from a menu item, for that I defined in the onExecute event, the follow:

if ({sc_menu_item} == “item_4”)
{ sc_exit(); }

but not work, even I tryed puting sc_exit(); directly but I don’t have good result

What I need to get the onExecute event works, or how can I close the application

regards

Marcelo

I’m not sure what you try to achieve. Do you want to close the entire applications? Then you can select ‘leave’ in the menu option.

Albert,

thanks for response, yes, what I want is close the app, what I’m trying to do is a popup menu called from grid app (link), and I need to have the possibility to close the menu application, I don’t know if i’m clear.

I will try with target leave, thanks

best regards

Marcelo

Albert,

I tested the leave option, this works when run the applition alone, but not work when it is called from other application across link

Please some idea to do that

regards

​Marcelo

You want to close the application from a modal form. Problem is that this is not so easy as it looks and actually I have no idea how to achieve that, as the underlying application is below and just waiting for the modal form to close. But I hope someone else has a good idea. I’m affraid you have to use javascript.

Try this in the application that opens inside the menu application…

Create a “Button” of type “JavaScript” and paste this code in it:

window.parent.parent.$("#TB_overlay, #TB_window").remove();

or this:

window.parent.$("#TB_overlay, #TB_window").remove();

Dear Mamede,

thanks for response, the problems with your suggestion is that a menu application dosn’t permit to create any type of button, or I don’t know how can I do it (I’m a beginer), please, are you have any other suggestion

best regards

Marcelo

There is at least one application (control/form/etc) that opens inside the menu application, right? The button should be in this (control/form/etc) application…

Mamede,

do you refer to origen application from I call the app menu? yes, but the app menu is modal and I can’t access to the button in the origen app, other wise, can be more elegant and clear have the close option in the same app

really I apreciate your help

regards

Marcelo

Me again,

I solved (I think) puting the next code in the onExecute event

if ({sc_menu_item} == “item_4”)
{
?>
<script>
window.parent.parent.$("#TB_overlay, #TB_window").remove();
</script>
<?php
}

regards

Marcelo V?a

Hello,

this is working in the SC enviroment, but in the production enviroment in a Linux server it isn’t work

some idea??

Regards

Marcelo