GeneXus - GXFlow : How to retrieve username of the user - business-process-management

I'm working with GeneXus and I'm trying to create a Business Process Diagram for GXFlow.
I need to read the logged user's username.
I've tried to read the &WorkflowUser.Name variable but it doesn't work.
How can I do that?
Thanks!

If you have the same problem, this is the solution:
http://wiki.genexus.com/commwiki/servlet/wiki?10645,HowTo%3A+Getting+Logged+User

Related

Spreadsheet : Issue in fetching current user email id

I am using Session.getActiveUser().getUserLoginId() to fetch the current user's email id but other than creator of the spreadsheet it is returning empty string. I have also used getEffetiveUser() but no hopes.
I will be appreciate if i could get some suggestions on this.
Many Thanks in advance.
Regards,
Chetan
Quote from the Google documentation:
If security policies do not allow access to the user's identity, User.getEmail() returns a blank string
Note that User in the above code is a sort of "placeholder" for the "User" class, which the Session.getActiveUser() returns.
If your script is set to:
web app deployed to "execute as me"
You can not get the user email.
So, the one thing I can tell you for sure, is that your code does not have permission to get the user info. I can't tell you why, because I don't know the conditions and settings under which your code is running.
Link to Google Documentation for getActiveUser method

Uid has already been taken in ruby?

I'm new in ruby on rails. I have done my deployment of ruby site (catarse) on linode. When I'm doing my first signup using normal method or aAuth i.e facebook login it creates the account. But when I'm trying to create another account I'm getting the error 'Uid has already been taken?' Do anyone have idea about this error ? Please help
This is an indication that you are trying to create a new user with a UID that already exists in the system. The best place to start is to look up the UID of your first created user - it's probably not what you expect it to be (perhaps nil, perhaps some error code). To fix, you'll want to find out what's causing your UID to be set incorrectly, and adjust that code in your user creation method.

How can I access the name of the user running a script embedded in a shared spreadsheet?

I have a Google Spreadsheet containing a script that I wrote. The script updates a per-person sheet named after the logged in user, or creates a new one if it's not there yet.
I shared it in "can edit" mode with other people, expecting the code accessing the user name to work as it did in my case, but apparently it doesn't.
Google Apps Script seems to contain three ways to get the name of the current user:
Session.getActiveUser()
Session.getEffectiveUser()
Session.getUser()
and all of them return the empty string when I'm not the user running the script.
(Btw I'm having a hard time to tell the difference between them...)
Considering that I'm sharing this spreadsheet in read/write mode, I would be a bit surprised if this was an intended security method... it's not like I don't know the emails of the people accessing the spreadsheet I've explicitly shared with them... Plus, Google is asking for permission anyway, couldn't it ask for permission to access the user name as well??
Is there a way around this?
Is there a way around this?
These methods only work if you're using a Google Apps account and you're on the same domain as the user. If not, then there's no way to get the user id. AFAIK Google removed this feature completely for regular accounts. You may try to argue with them opening an issue here.

Email creates new record in rails3?

I'm not really sure where to start with this one, but here is what I'm looking to do.
Lets say you've registered at a website (yourwebsite.com). Your username/email is joe#shmoe.com.
If you email newrecord#yourwebsite.com, I'd like a new record created by your user (meaning you have to email it from a registered user's email - such as joe#shmoe.com).
I'd also like to add some variables in the email body, that can be set to their respective fields in the new record.
Does anyone know if this is possible?
sure is possible - have a look at http://cloudmailin.com/ too - they do all the receiving side of things for you and then just 'post' the email into your application.
It's definitely possible - that functionality is available in basecamp.
I've never done it myself, but looks like this article describes how to process incoming emails in rails. Good luck!

Keeping track of variable across multiple requests in Grails

For a webapp written in Grails I would like to keep track of the current users account. In addition the account-name should be displayed as part of the url.
1) Keep the variable in the session
2) Pass the variable via account parameters
Currently I am experimenting with option 2 which allows me to create URL's like http://app.com/accountname/controller. The drawback is that with every URL I will have to pass the account name along as a variable. This is tedious and error prone.
Is any of the two options preferable? Are there better ways in Grails to achieve this?
Regards,
Jens
I have been using a session variable to keep track of the user's account.
Ie: session.user = userAccount;.
You could set this in your login controller.
A better way to keep track of the user is probably to set a cookie. It will be sent to the server with every request & you can easily read it. Why do you need the account name to be part of the URL? I can't think of a good reason to put the current users account in the URL. What happens when someone copy's & paste a link, and someone else follows it? Can you give some more details on what you're trying to do?

Resources