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
Himanshu Patel 55Himanshu Patel 55 

how to find User id hardcoded in code

I am trying to reduce number of API user as our org is very old and so much leagacy code. 

I had found API User Id is hardcoded in some methods.  How can I find all classes where  is this referenced. 
Derrick AbbeyDerrick Abbey
Hi Himanshu,

If you're using the developer console, you can press ctrl+shift+h to bring up a search box that will allow you to search all your Apex in that org. 

If you're using an IDE tool like VS code, you can export all of your apex into files and then use the search function there to search all of the files.
mukesh guptamukesh gupta
Hi Himanshu.,

You can search by VS Code:-

Right Click on Default-->>> Click on FInd in Folder

User-added image

if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Suraj Tripathi 47Suraj Tripathi 47
Hii Himanshu Patel,

1.If you're using the developer console then you can use Ctrl+Shift+H that will allow you to search all your Apex in the org. 
2.If you're using VS code then you can use Ctrl+Alt+F that will allow you to search all the ocuurance of a string.

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks and Regards,