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…

Silly Dev Trick: How to delete the apex debug logs with Use Tooling API

Every year they seem to up the limit but for those doing intensive testing and running up your logs here is a quick way to release the storage: tl;dr Run the following soql in developer console with the ‘Tooling API’ checked: select id, LogLength, LogUser.Name from apexlog order by LogLength DESC select id, LogLength, LogUser.Name…

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…

Network Solutions – Nothing ever Changes

Back in 2015 I moved all my domains over to Google mainly because for 12$ a year they’ll maintain my domain registration, run my DNS, and give me free email ala gmail and at the time I was still hosting my own email, DNS, and web and the email maintenance was just too much specially the never ending spam…

Running CSVFIX on Mac

CSVFIX has been my go to for command line ETL but I have always run it on Windows. After running in to some issues with a CSV file loading in to Salesforce I needed something on the mac to ‘peak’ in to the file and do the usual amount of stuff that I’m used to…

Silly Dev Trick: Running Lead Assignment Rules on New Leads

Another posting that resulted from a lot of great examples on the web but none that were actually bulked and tested. So the business case is “Run the default lead assignment rules when leads are created”. Seems easy but when you look at the documentation, forums, and blog postings it is all none bulked examples…

Apex sObject Examples

sObjects are great for dynamic apex where you need to re-use code across objects and/or need to dynamically set data. I’ve had several projects where the same logic is used across many objects such as date, territory, and ownership. Recently had a use case where I used sObjects and a custom setting with a list of…