Who pushed the button?

So I did a search and couldn’t find anything related.
I want to know who pushed my button… but seriously…
I have a reset button to try and track belt life on a piece of equipment. We want to be able to track who pushed it.
I have client event script that works fine but the issue is that it is randomly pulling a user who is logged in not the user who actually pushed the button. How do I work around this?
This is what I have…

You need to somehow have the user log in again to use the button.

… but the issue is that it is randomly pulling a user who is logged in not the user who actually pushed the button.

That’s not random. That’s, as far as the system knows, the current user.

One way would be to have a popup that offers the user a choice. “Username password required to perform this action. [Proceed] [Cancel]”. Pressing proceed would log the current user out and present the login dialog. I don’t use Vision anymore so I’m not sure of the details.

I hear what you are saying but the log ins are all different people already logged into the project on their respective computers. So I need to identify which user who is logged in already was the one who pushed the button.

I don’t get why you can’t use the built in audit log?

1 Like

It’s not clear from your question whether each user has a unique login or they are sharing a single login. If they are unique does system.security.getUsername not return that unique name?

Each person has a unique log in. But yet when I run that script it pulls a random person from the list of people who are logged in

Call the script that records who pushed the button from the button push event (not a tag change event).

1 Like

Sounds good but I cant seem to find where that would be located.

Right-click | Scripting …

I’ve tried that but there isnt any access to any properties that will give me which user pressed the button though

It works!! I guess I didnt try to use the security.getUsername in the component scripting window
Thank everyone!

1 Like

You were searching for a Python scripting function in the button’s properties. It won’t be there.
Just add = system.security.getUsername() where your cursor is.