function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mavsmavs 

Passing parameters from Visualforce page to Apex class

Hello

 

I am a newbie to visualforce pages. From 3days i am trying to figure out a way how to pass parameters from VS page to apex class. Please help!!

 

I have a custom link on home page which points to VS page. Based on the loggged in user, i have to check few things in the custom object and return those results to the VS page.

 

For this i need to pass logged in user id to the apex class query the custom object for this userid and return few fields data.

 

Can someone Please advise how to solve this....Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
MakMak

Hi Mavs,

 

You don't need to pass any param for cuurently logged in user. You can simply use UserInfo.getUserId().

Please check documentation on UserInfo class.

 

cheers

Mak 

All Answers

MakMak

Hi Mavs,

 

You don't need to pass any param for cuurently logged in user. You can simply use UserInfo.getUserId().

Please check documentation on UserInfo class.

 

cheers

Mak 

This was selected as the best answer
mavsmavs
Thanks mak. it worked!!!