3

Is there a way to get the developer console to return results from Visualforce Components when using the Edit -> Search in Files feature? I get VF pages, and Apex Classes, but not VF Components.

  • Not sure about the console on components, but I can suggest for global code search (and editor) I use SublimeText3 with MavensMate. The effort in setting it up (not much) is well worth it. ctrl+shift+f performs a lightning fast search through all code resources, clicking on results jumps you to that file at that line. Then there is Eclipse with the force.com IDE, and many other IDE's which have the same feature.... but mavensmate is the best ;) - my opinion. – Mike Katulka May 18 '15 at 19:54
1

If you use something like the Chrome developer tools when running the "Search in Files" functionality you will see the REST API call going out to the web services.

https://na2.salesforce.com/services/data/v33.0/search/?q=FIND%20%7BFoo%7D%20IN%20ALL%20FIELDS%20RETURNING%20ApexClass(id%2C%20name%2C%20namespaceprefix%2C%20body)%2C%20ApexTrigger(id%2C%20name%2C%20namespaceprefix%2C%20body)%2C%20ApexPage(id%2C%20name%2C%20namespaceprefix%2C%20markup)%2C%20ApexComponent(id%2C%20name%2C%20namespaceprefix%2C%20markup)&_=1431996616461

After URL decoding the SOSL query is:

FIND {Foo} IN ALL FIELDS RETURNING ApexClass(id, name, namespaceprefix, body), ApexTrigger(id, name, namespaceprefix, body), ApexPage(id, name, namespaceprefix, markup), ApexComponent(id, name, namespaceprefix, markup)

ApexComponent is labelled "Visualforce Component", so in theory it should be searching the VF components as well.

I confirmed that it can indeed find known content in a VF Component. enter image description here

However, it was a bit hit and miss about what it would actually find. Other terms that I know appear in the markup didn't come back in the results.

As Mike commented, pulling down the metadata and then searching it locally with the tool of your choice may be the best option.

3

You can add Google Chrome Extension Salesforce Advanced Code Searcher.It searches Apex Classes,VF Pages,Visualforce Components,Apex Triggers.

enter image description here

Here is the Chrome Extension link

FYI. I am not affiliated with above chrome extension

  • Do you have any affiliation with that product? It's fine if you do or do not. However, if you do, please state so in your answer. – Daniel Ballinger May 19 '15 at 0:46

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.