You need to sign in to do that
Don't have an account?
murdoc
Current user Id in apex class
I need to compare Owner ID and Opportunity Team Member to a User ID in an Apex Class, if the ID's don't match they can't access the VF page. Any idea what this would like. Thanks in advance.
All Answers
By current user, you mean the user viewing the record/page, correct? If so, then you can use UserInfo.getUserId(); method to retrieve the id of said user.
Thanks, that worked, but now I'm still running into issues with the Opportunity Member ID. Any ideas
I'd love to help, but your issue is a little vague. Do you mean you're having issues obtaining the Opp Member Id? Or how to use it to retrieve OpportunityMemeber data? Or using the data to compare against the current user id and/or opportunity owner id?
Also, a little more information on the usage of your VF page would be helpful. Showing your code is probably the easiest way to help, but I can understand if you don't want to.
Right now obtaining the ID would be good. Having a hard time calling it out. I can do the camparison if I could find out how to obtain the Team Member ID.The code is below.
This worked great. Thanks for prompt and accurate solution!
Glad to help!