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
R R MR R M 

Need to Search account based on Current logged in User phone and Account Phone

Hi Folks, 

Need help to develop visualforce page with search option account.
Should Use Current loggedin User Phone and Account phone. 
if iam trying to search with my account id = 12345.
if Account has phone number (900000001) and 
Current Loggedin User Phone number (900000001) 
Then
 User.phone==account.phone(if user phone and account phone both are same) then Account(12345) should disply on visualforce. except Account(12345) no one other account should not display. 
Please do help. this is an urgent thing need to have. 
Thanks in Advance.
RKSalesforceRKSalesforce
Hello,

We need  2 queries here :
1. To get logged in User record.
2. To get Associated Accounts.
User usr = [Select id, Phone from User Where Id=:UserInfo.getUserId()];
List<Account> accountsList= [Select id, Phone from Account where Phone =: usr.Phone];
Please let me know if you have any question and mark as best Answer for others help.

Regards,
Ramakant
R R MR R M
HI Ramakant, 
 Please do Help with VF and apex code. Because am not good in Development much.    
R R MR R M
Folks, 
Please do help, i got struked in Middle.