A field wasn’t found or isn’t supported for Apex action

When using invokable apex and you’re passing in an object or list of objects you might get this error: “A field wasn’t found or isn’t supported for Apex action” For me it was the Billing fields on the Contract but the quick fix is basically when you build your list of records do not select…

Custom Metadata Methods

“Custom Metadata Settings” with Spring 21 finally got the same methods as their sibling “Custom Settings”. They’re basically the same except with one exception: getValues method got renamed to getInstance for Custom Metadata Settings. Also the __c got replaced with __mdt for the object name, the rest is pretty much the same except for the…

Silly Flow Trick: Record Count

On a project that has me doing a lot of Salesforce Flow. I’ve seen a lot of people using a loop to do record count which was probably the only solution a couple releases ago but with all of the enhancements constantly coming it is hard to keep up. Anyhoo, this is a quick way…

How to Find Salesforce Hostnames for URL Redirects in Flow

When doing custom salesforce buttons and actions, knowing what your hostname is and/or the instance you are on is important when trying to add functionality and redirects to other custom or managed package resources. And with Lightning and Apex you have javascript and the URL methods respectively in order to determine your URL and hostname…

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…

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…