0

I created a custom button in Account. When user clicks on this custom button and it will access to a VF page. In the VF page, I would like to display and capture who clicks the custom button. So my initial approach is to create a custom lookup field that lookup to User object. But I'm having problem of how to find out who clicks the custom button and capture it into this lookup field then populate it in the VF page.

1

Use UserInfo Class, it will help you get any information you need.

https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_userinfo.htm

  • I got it working by using UserInfo.getUserId() method to assign it to the lookup field. – R.Spark Jun 9 '14 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.