Salesforce Test Classes never complete

I recently ran in to an issue where my test classes were running and running but never completing. It being close to Summer 20 release I thought it would resolve itself and literally let one test class running for days/over the weekend. I tried multiple sandboxes/instances so I was pretty sure it was on the…

VS Code will not launch Chrome to Authenticate new Project

If you cancelled out or for whatever reason cannot get VS Code to launch a new browser window to authenticate your org do the following from command line: lsof -i tcp:1717 kill -9 <the process ID> Instructions are here: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_troubleshoot_cancel_auth.htm Sounds easy to remember…but then a couple months pass and here I sit wondering why I…

Silly Dev Trick: Apex Flex Queue with Web Callouts

More of a watch out for this but when using Apex Flex Queue with classes that do web callouts you have to add ‘Database.AllowsCallouts’ to your queueable class like so: public class ExampleQueueableClass implements Queueable, Database.AllowsCallouts{ This got me but after the usual hunt and peck the googles answered the call: https://salesforce.stackexchange.com/a/216346/17245 This is the error the…

SFDX Command Process Quick Reference

There are some great resources for Salesforce DX but it can be confusing knowing which commands align with the functionality you’re trying to execute. Below are some commands and examples of a basic workflow for setting up DX, pulling data from a sandbox using a change set instead of creating a package.xml, and then pushing it…

Using SFDX to execute apex against a scratch org

Been doing a lot of SFDX lately and in automating the deployment, testing, and validation of unlocked packages I have found that the documentation around sfdx force:apex:execute is a bit lacking. There are a couple things that got missed in the documentation that you need to know to get this working: The file format is just like…

How to Run Data Loader from the Command Line

There are several guides from Salesforce and other blogs on how to run Salesforce Data Loader from the command line. In addition you can script sfdx to do data loads as well but it seems that only supports bulk which for certain objects can be buggy so we might explore that later for this entry…

Find the API Name from the Field Label

I recently had a use case where I was going to take a drop down value and use that to pull a value from a separate lookup object. I would have “Hourly” and my logic would return “Hourly__c” which I could then use dynamic SOQL and sObjects to do some magic. I did not want to use hardcoded values…

Silly Admin Trick: Date Formats without adding Zula Time

Microsoft Excel…it loves to format dates in a crazy way. By default it will do day dash 3 digit month name and 2 digit year like this: 13-Sep-2016. Not helpful. In the U.S. your first instinct would be to change it to 2-digit day dash 2-digit month dash 2 or 4-digit year: 10/13/2016. Salesforce.com does…