What the Hack - DevConsole 🤖
The good and old Developer Console tool has been the first tool an Admin or a Developer uses to code and create components like Apex Class, Triggers, Lightning Component in Salesforce. But do you know there are more things that you can do in a Dev Console? In this post, we go through a few hacks and tricks that Developer Console has in store for us.
1. Opening DevConsole
Have you ever wondered why does the developer console always open in a new window? Is there any way you can open a Dev Console? Yes, we do it by using
https://domain.my.salesforce.com/_ui/common/apex/debug/ApexCSIPage
When you prefix /_ui/common/apex/debug/ApexCSIPage to your Salesforce domain URL, you can directly open the dev console in a new tab.
2. Query Builder
We all have written queries in the Query Editor in the Dev Console but always forgot the field's API name. Well, there is a built-in query builder in Dev Console. All you have to do is to open Dev Console go to File >> Open >> Entity type >> Objects. From the entities select the object you would like to query and click Open.
Once you open an object you can select multiple fields in the Developer Console and just click the Query button. All the selected fields will be automatically be queried.
3. Searching Files
You can search for specific words or terms used in the Apex class, Triggers, or Visual force pages. Using this feature of Developer Console you can search across all the code where you have used a specific line of code. This feature is mostly used when you want to search across all your code except the Lightning components.
Find this option under Edit >> Search in Files.
4. Fix Indexation and Code Formatting
Writing multiple lines of code without proper code formatting and indexation can lead to long paragraphs or messy code lines which can be really tough to read the code for the next developer.
Using the Fix Indexation feature you can highlight your code lines and format the indexation for the code. This makes the code look clean and clear to read and understand.
You can use both Fix Indexation and Fix Code Formatting using the below menu options in Developer Console.
Go to Edit >> Fix Indexation
OR
Go to Edit >> Fix Code Formatting
5. Add or Change Log Levels
Yes! Debug logs, You can set and change log levels for the users directly from the Developer Console. You would only need the UserId of the user for whom you can set the data.
6. Change Theme and Font
Want to change the look of the Developer Console Editor.
You can do that from the Help menu of the Developer Console. Look for the option Preferences and change the Editor Font and Editor Theme from the default.
Don't forget to click save after changing your preferences of the font and the editor.
7. Optimize Query Performance
From the Developer Console, you can find out the performance of the SOQL query using the Query plan button. You can write a SOQL query under the Query Editor and click on the Query plan button to see the cost of the Tablescan.
This can be very useful when you want to optimize long queries and see the cardinality, cost of the Table scan.
0 comments:
Post a Comment
Please do not enter any spam links in the comment box.