Category: Blog
-
How to create an US Map Lightning Web Component
I’ve been exploring the possibilities of using events to send data between Lightning components to keep them as generic and configurable as possible. This map component was designed to highlight and show data for individual US states. The example below shows how the map can be configured on a Lightning page. As I tab out…
-
An easier way to make VisualForce tables mobile friendly
The default behavior of VisualForce tables (apex:pageBlockTable and apex:dataTable) is static – they don’t rearrange the data to better fit tablets and smartphones. This example shows how tiny the table data can appear on an IPhone. Sometimes the table will not decrease in size and will require the user to scroll sideways to see all…
-
How to quickly copy production data for testing
Salesforce CLI has command options to export/import data hierarchically. For example, you can export a few accounts plus their respective opportunities in a tree structure and import them that way without having to manually rewire them with the new IDs in the target org. Here are 4 SFDX commands you can run on Terminal/Command prompt…
-
How to Create Charts using SVG and VisualForce
VisualForce is used to generate HTML pages but it can also create other kinds of presentation. One common alternative is to render VisualForce as PDF. This article proposes a third type of presentation that can be generated via VisualForce: images. Scalable Vector Graphics is a graphics format that uses a markup language to describe the…
-
How to Connect to Salesforce from a Python/Jupyter Notebook
It might be useful to extract data from Salesforce directly into Python and manipulate the data as a Pandas dataframe. First, you need to create a Connected App in Salesforce and copy the consumer key and consumer secret. Then start your Jupyter Notebook and create a Python notebook. Start coding your Python notebook as follows:…
-
Unlock ‘All or Nothing’ Validation Rules in Salesforce
This week someone asked me to help with an interesting Salesforce validation rule that, in plain terms, meant “Either enter these 3 fields or leave all 3 fields blank”. That is a type of XOR operation: an Exclusive OR. A logical operation between 2 or more conditions in which either all operands are false or…
-
Genius Simple Trick to Eliminate Repeated Spaces in Salesforce Formulas
Neat trick that can be used in Salesforce formulas. It converts multiple spaces between words into a single space. This kind of cleaning would usually be done in Apex. The ~ and ^ could be any character but these were preferred because they are the least used in normal text and can still be typed.…
-
How to get a lead assigned to a random person in Salesforce
There isn’t a function to get a random number in the context of Salesforce formulas. The only way I know of is to base it on time. Specifically, the seconds part of the time. If you create a formula with the expression below, you will get a random number (*) between 0 and 59, which…
-
Data modeling insight from the Bible
“In the beginning, God created the heaven and the earth.” The very first sentence in the Bible lays out all dimensions of information:– the time: in the beginning– the person: God– the action: created– the location: the heaven (the first reference to a place)– and the matter produced by the action: the earth Those correspond to…