You need to sign in to do that
Don't have an account?
Sudhanwa
Finding out if the logged in user is from United States
Hi all,
I have a requirement where in I should identify if a user is from United States region. There is a download button which should allow only users from US to download files. Is this achievable through Apex? Or, should it be done via javascript? Can you please tell me how?
Thanks in anticipation.
-Sudhanwa.
If you are talking about login history then you will not be able to access that information through Apex
I am talking about the time when the user clicks on 'download' button, he/she should be able to do it only if in US. Otherwise, no download should be possible.
-Sudhanwa.
Try the sample code give below :
User u = [select localsidekey.communitynickname,lastname,firstname from user where id=:userinfo.getuserid()];
Hope this helps.