What is Salesforce developer constantly looking for?
The same as all developers – optimization. We aim to improve our code to make it of better quality, clean, and fast. We want to write clean code, as smooth as silk. In my work as a Salesforce developer, I often came across, and still do, situations that required, in my opinion, too many steps, too many clicks. I just wanted to simplify them. How did I do that?
It all starts with an idea in your head. Think about which activity seems tedious to you, and then optimize it. Do you use IntelliJ IDEA every day? Add it to the system startup. Want to have an up-to-date version of your code every morning? Write yourself a script that automatically does a pull from your repository. Do you often create test cases using GUI? Write Apex scripts that do this for you in two clicks. Frequently logging in to a specific user on your sandbox? Write yourself a Chrome extension that allows you to do this with a keyboard shortcut.
Today, I’d like to show you ideas that have made me working more comfortable – me and the people in my project, not just Salesforce developers.
1. Release version in Company Information
To check which release our Salesforce environment uses, whether sandbox or production, go to status.salesforce.com and enter the instance number, CS105, for example, taken from Setup > Company Information.
A plugin that displays Release Version directly in Company Information. Additionally, it allows you to check the current status of your org, its history, and if any maintenance work is planned with just one click.
*Install the Tampermonkey extension for Google Chrome. To quote the author, “Tampermonkey is used to run so-called userscripts (sometimes also called Greasemonkey scripts) on websites. Userscripts are small computer programs that change the layout of a page, add or remove new functionality and content, or automate actions.”
*After installing the plugin, click the Tampermonkey icon available in extensions for Google Chrome:
*Then, click Create a new script.
*Paste the source code available HERE.
*Save your changes by using CTRL + S hotkey.
*Click the name of the script (SF Version in Company Information).
*Go to the Settings tab.
*Make sure the options are set as in the following screenshot:
*Voilà! New functionality appears when you go to Setup > Company Information.
2. Copy the JIRA’s task name to the clipboard
Projects adopt different work methodologies and ways of organizing work. In my project, it was established that in the commit body, I should type the technical identifier of the JIRA’s task, then press Enter, then type the task’s title. Selecting two lines of text caused the cursor to jump a lot and I ended up with only one line selected or nothing at all.
A button that copies the job ID and its title with a single click. A blue button, consistent with the JIRA’s look ☺
*Copy the script content available.
*In line 9, change the address from jira.YOUR_COMPANY_HERE.com to the JIRA address you use for the project.
*Follow the same steps as in the previous plugin to install.
*The Copy to Clipboard button appears on each shuffle in JIRA.
3. Build status in JIRA’s task
Many projects, including mine, use Continuous Integration for deployments. As such, I spend more time reviewing tasks in JIRA. I wanted to know if a task I committed caused the build to stop compiling.
A plugin for JIRA that shows what the current status of a build is without opening the Bamboo Plan. This is possible if the Bamboo instance exposes the build status as an image.
*Download the script available.
*In line 9, change <YOUR_COMPANY_DOMAIN> to the domain name of your server in JIRA.
*In line 12, change <YOUR_BAMBOO_DOMAIN> to the domain name of your server in Bamboo and <YOUR_BAMBOO_BUILD> to the technical name of your Bamboo Plan.
*Install the script in Tampermonkey as in the examples above.
*The status of the Bamboo build appears on each task in JIRA.
4. Record search engine in Workbench with export to Excel
Limiting the records displayed after using a SOQL query in Workbench involves adding a condition to the WHERE clause. What if we don’t know the exact values of the data, only approximate values?
The script adds a search engine, allowing us to filter records in real-time. Besides, we can export what we see on the screen to Excel. If we used the filter, we export only what is visible on the screen.
*Download the script available.
*Install the script in Tampermonkey.
*Go to workbench.salesforce.com, log in with your Salesforce environment. Write a SOQL query, click Query. You see a filter box on the screen and a blue Download as Excel file! link.
That’s it for this article. I hope I’ve inspired you with these ideas to create your tools that will make work in Salesforce easier. Be creative, the possibilities are endless!
- Salesforce Developer
Salesforce developer, associated with Craftware since November 2017. As Dev Lead, he strives to deliver quality solutions and support his team. Privately, a fan of Sci-Fi cinema, stand-up, and recreational computer gamer.