Determine current user in a Client Script?

dstuart
Kilo Expert

I have need to confirm an operation with the current user, and need to know the current user's ID.

I am familiar with gs.getUserID(), but that appears to be a server-side function, usable only in a business rule.

I also would like to use the confirm() function, which appears a client-side function, usable only in a client script.

So, is any one aware of something similar to gs.getUserID() that will work in a client script? Or something similar to confirm() that will work in a business rule?

Thanks,
Dave

16 REPLIES 16

Assuming u_requested_by is a reference field to the user table, reference qualifier can be used to getting self-selected.

I'd suggest Opening a new post so you can put this question together with the specifics about your question.

This allows you to mark it as answered and will probably get more views as it'll be "new".

You could use a reference qualifier on the variable to exclude the logged in user.

I could get something on the current Reference Qualifier we had:

Added this filter: 

var filter = 'active=true^sys_id!=javascript:gs.getUserID()^';

yeah. Is it working?

Yep, like a charm!