Author Archives: Ezra Kenigsberg

Unknown's avatar

About Ezra Kenigsberg

#Salesforce architecture/data guru & @BigCommerce employee; film noir buff; expatriate Jewish New Yorker; proud papa

Soft Data Validation

Q: How might I validate a record but still allow it to save if it fails?

A: I use a little bit of formula-field sneakiness.

Let’s say you’re a consultancy and you’ve got three project-related dates on an Opportunity (Close Date, Implementation Date, Go-Live Date) that need to occur sequentially. Here’s what that output could look like:

To implement it, I suggest creating a Formula(Text) field named “Date Audit” like this:

IF(NOT(ISBLANK(Implementation_Date__c)) &&
    Implementation_Date__c <= CloseDate,
   "❌ Implementation Date Must Be Later than Close Date" & BR(),
   "") &
IF(NOT(ISBLANK(Go_Live_Date__c)) &&
    Go_Live_Date__c <= CloseDate,
   "❌ Go-Live Date Must Be Later than Close Date" & BR(),
   "") &
IF(NOT(ISBLANK(Implementation_Date__c)) &&
    NOT(ISBLANK(Go_Live_Date__c)) &&
    Go_Live_Date__c <= Implementation_Date__c,
   "❌ Go-Live Date Must Be Later than Implementation Date" & BR(),
   "")

How Many Records Does [User X] Own?

Q: How many records does a given user own in Salesforce?

A: A quickie URL hack gets your answer. Paste the following after force.com in your address bar, replacing 005ABCDEFGHIJKL with the desired user’s ID:

/setup/user/userstorageusage.jsp?id=005ABCDEFGHIJKL

the page looks like this (though presumably with many more records than you’d find in one of my Dev Sandboxes!)

individual User’s “Current Data Storage Usage” screenshot

Where’d this come from? If you navigate to Setup | Data | Storage Usage, there’re two underknown sections at the bottom of the page, for “Top Users by Data Storage Usage” and “Top Users by File Storage Usage”.

Clicking a username in either one of those sections gets you the URL and page shown above.

Extracting the URL from a Hyperlinked Google Sheet Cell

Q: I’ve got a Google Sheet cell that links to a URL. How can extract that URL?

A: The best solution I’ve found comes from this StackOverflow post.

Step by step:

1] click “Extensions | App Script” in your desired spreadsheet

2] in the Apps Script browser tab, select all existing text and replace it with the following:

/** 
 * Returns the URL of a hyperlinked cell, if it's entered with control + k. 
 * Author: @Frederico Schardong based on https://support.google.com/docs/thread/28558721?hl=en&msgid=28927581
 * and https://github.com/andrebradshaw/utilities/blob/master/google_apps/convertHiddenLinks.gs 
 * Supports ranges
 */
function linkURL(reference) {
  var sheet = SpreadsheetApp.getActiveSheet();
  var formula = SpreadsheetApp.getActiveRange().getFormula();
  var args = formula.match(/=\w+\((.*)\)/i);
  try {
    var range = sheet.getRange(args[1]);
  }
  catch(e) {
    throw new Error(args[1] + ' is not a valid range');
  }
  
  var formulas = range.getRichTextValues();
  var output = [];
  for (var i = 0; i < formulas.length; i++) {
    var row = [];
    for (var j = 0; j < formulas[0].length; j++) {
      row.push(formulas[i][j].getLinkUrl());
    }
    output.push(row);
  }
  return output
}

3] click the Save button (a floppy disk!)

4] return to your spreadsheet’s browser tab and type the formula =linkURL(A1) in any cell (replacing the A1 bit with the relevant cell).

That’s it! This JavaScript formula works with both cells that have

  • =HYPERLINK() formulas and
  • embedded links (like ones copied from Salesforce pages 🙂)

Too Many Jira Updates

Q: I’m getting too many notifications from Jira. How do I get more signal, less noise?

A: The three ways I do it:

1] When I get a Jira email I didn’t want, I click the “Manage Notifications” button in the lower left-hand corner of the email:

. . . and chop down Default Notification Settings. Here’s where I’m at now:

. . . and nothing else.


2] I also keep a sharp eye on how many tickets I’m “Watching“, to use Jira’s term of art.

I turn individual tickets’ Watched status on and off using the eyeball icon in the upper right-hand corner of an individual ticket:


3] I bulk-deactivate Watching for a bunch of tickets by

a] turning on JQL after a search:

b] searching for watcher = currentUser(), then choosing “Bulk change all X issue(s)” from the hamburger:

c] walking through the “Bulk Operation” wizard, and choosing “Stop Watching Issues” when prompted

Tickle Those Old Flows, Kids

If your active, Autolaunched Trigger Flow was last modified before Summer ’21 (around May-June 2021), it won’t show up in your Flow Trigger Explorer.

Thanks to Jack O’Brien for finding the relevant help article!

screenshot from Salesforce Help explaining that Trigger Flows created before Summer ’21 don’t show up in Flow Trigger Explorer

oh yah. . . you can translate a number like “232” into a seasonal Salesforce release by modifying the 248 in the following URL and seeing which release’s notes pop up:

https://help.salesforce.com/s/articleView?id=release-notes.salesforce_release_notes.htm&release=248&type=5

. . . Salesforce increments each seasonal release by 2, and counting back from Spring ’24 (internally numbered 248) gets us. . .

  • 246 = Winter ’23
  • 244 = Summer ’23
  • 242 = Spring ’23
  • 240 = Winter ’22
  • 238 = Summer ’22
  • 236 = Spring ’22
  • 234 = Winter ’21
  • 232 = Summer ’21

so there ya go! Looks like that URL-hacking trick works all the way back to 218 (Spring ’19).

Two More Bugs in DemandTools

Did the old DemandTools (v2.xx, the one with the ’90s Windows 3 UI) have these bugs?

1] if

  • I have a unique-indexed field and
  • I tell DT to copy a losing record’s unique ID onto a winning record,

it deletes the losing record. . . even if I told it not to delete losing records

2] the FieldCopyUnique command fails to migrate certain values from losing records to winning records

  • for me, it’s working with Text, but failing with URLs and Phone Numbers

UPDATE 2024-04-03: we think this problem was caused when by cloning one of DT’s pre-existing merge scenarios. If we build a scenario from scratch, FieldCopyUnique works properly.

Friggin’ Compound Fields

Q: How do I find which fields in a Salesforce object are Compound fields?

A: Run this SOQL query:

SELECT Label, MasterLabel, Name FROM EntityParticle WHERE EntityDefinitionId = 'Opportunity' AND FieldDefinitionId IN (SELECT DurableId FROM FieldDefinition WHERE IsCompound = TRUE)

. . . change Opportunity to the API Name of the object you’re querying.

The query above is mighty useful when you’re querying the Bulk API.

The Bulk API can’t handle Compound fields.

Props to this StackExchange post!