Menu application - default initial application

Does anyone know how to set a dynamic initial application in menu? for example, user1 logs in and see initial application A and user2 logs in and see initial application B.

Thank you.

Just use a blank application and do your filter there:
if user1 then sc_redir application 1
if user 2 then sc_redir application 2

In your menu you set the blank application as default. When that loads the execute will fire and your needed application will start.

Thank you for the suggestion, Albert. It works perfectly! :slight_smile:

I use groups for my security so doing individual users would be extremely difficult, but I have found a way of using the groups to show specific calendars for specific groups.
Doesnt take much just on the onload even of the menu set the application you want for the groups with a variable.
Then assign that variable to the default application in the menu settings area.
for example:
in the default application i put this variable:
$security_menu
I define that variable by coding in the OnLoad event of the menu:

/**

  • Check role for calendar to show
    */

// Check for record
$check_sql = “SELECT login”
. " FROM imsi_employee_sec_users_groups"
. " WHERE login = ‘" . [usr_login] . "’"
. " and group_id = ‘2’";

sc_lookup(rs, $check_sql);

if (isset({rs[0][0]})) // Row found
{
$security_menu = ‘Gen_Cal_Data’;

}
else // No row found
{
$security_menu = ‘Gen_Cal_Data_LOA’;

}

This way if an HR peron logs in they see the Gen_Cal_Data Calendar
if they arent a HR person they see the Gen_cal_Data_LOA calendar…

Hope this helps…

Kevin

You can also use switch case statement for a common variable for displaying different initial applications for different users. This will allow future prospects of allowing more departments to be created in the project.

Very handy post gentlemen. Keep up the good work! We (I) need it!

Hi.
How can we change the default application in a Menu App ?
The solution above works to assign a completely different app, but my Main Menu contains code and I don’t want to duplicate it. I just need to change the default application the Menu shows when it opens ?
Or if there is a way top open a second tab that would make it.
Thx.

are you referring to the settings in menu application?
Open your menu application, click settings and scroll to the bottom

Sorry for not explaining well.
I did need to change dynamically the default app of my main menu.
I’ve found a way using a Blank App (assigned in the default app of the Main Menu). This blank app can do a “sc_redir” within itself with the correct App according to a global variable or any other parameter.
Thanks.