Event Script (Client) user redirect not working?

I have not been able to make this script work on start up for (Client). I need a user to be redirected to a certain window of the project when he logs in…Did not have this problem before 7.6…the code I am using in the Event Script (Client) start up is as follows.

name = system.security.getUsername() if name == 'donald': system.nav.openWindow("Freshwater Central Facility/Main Windows/Overview") else: system.nav.openWindow("Tennaco SWD/Overview")

Did something change in the scripting or am I just missing something? I just need one user to have a different opening window then the rest of the users. Any help would be appreciated.

Are you authenticating using AD? I’ve noticed that the AD authentication now returns usernames in all caps. It might be that simple, you could try this and see if it works:

name = system.security.getUsername() if name.lower() == 'donald': system.nav.openWindow("Freshwater Central Facility/Main Windows/Overview") else: system.nav.openWindow("Tennaco SWD/Overview")

Tried it and it didn’t work…not sure what is going on…hmm…

Forgot to mention we are not using Active Directory Authentication. We are just using Internal Authentication managed by Ignition.

I just played around with this in the script playground and I don’t have any problems with it. I would check that the username you’re looking for is actually ‘donald’ and that you don’t have any windows set to open on start. If you are going to open windows up with a startup script then you don’t want any windows set to open on start in the designer.

Ok…well I did have a window set up to open on start up…I unchecked it and logged in with donald, but now every user name opens up that page. And I only need that one user name directed to “Yates Freshwater Central Facility”. But every other user that logs in needs to be directed to the “Yates Tenaco” window…any reason what would cause that?

Never mind I got it fixed…Thanks for your help Duff.

Hmmmm… no, your code looks good to me so I don’t know why it would open up the first window for everyone. Are you sure you are putting that code in the Client startup script area? I’m doing something similar, but based off of roles and it’s worked fine since 7.1.something.

[attachment=0]ClientScript.png[/attachment]

Ahhh, glad to see you got it. What was the problem?