Activity Forums Salesforce® Discussions How to find controller type in Salesforce?

  • Nikita

    Member
    October 5, 2017 at 3:48 pm

    Hi, santosh

    The easiest solution, in my opinion, is to download all the pages from Salesforce org with some tool (Migration tool, IDE) and then use something like 'grep' to get controllers and extensions. Cons: you have to have *nix environment or bash for Windows installed to use grep. Alternatively, you can use any code editor to look through the pages.

    Algorithms to get controllers:

    Using editor

    1. Run "Find in folder" command for the pages folder
    2. Search for " controller=" to get controllers or for " extensions=" to get extensions

    Using 'grep': run in terminal

    1. To get controllers: `grep --regexp=" controller=\".*\"" src/pages/* -oih > controllers`
    2. To get extensions: `grep --regexp=" extensions=\".*\"" src/pages/* -oih > extensions`

    These will create 'controllers' and 'extensions' files where in the beginning of each line will be controllers and extensions. You can then get class names from there.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos