Posts

Featured Post

Using SFDX & the Metadata API to Compare Page Layouts Between Salesforce Orgs

Image
Have you ever gone live with a Salesforce implementation or enhancement project only to realize that what the users see on the screen doesn't match what they saw during UAT testing? You may have forgotten to deploy your page layouts or lightning record pages. In this article, I'll talk about how to rapidly identify the differences in page layouts and lightning record pages between two Salesforce orgs using sfdx and the Metadata API. Prerequisites Install Git Install Visual Studio Code Install SFDX Install the Salesforce Extensions for Visual Studio Code Install GitKraken Steps Open the command palette and select SFDX: Create Project with Manifest Follow the prompts to select a project name and designate what root folder the project should be created in Select the empty template Expand the manifest  folder and open the package.xml file Replace the contents with the package.xml file from this GitHub gist Open the command palette and run SFDX: Auth

Embracing Package-Based Development on the Lightning Platform: Separating Triggers into Multiple Packages

Image
Consider a case where you might want to have a package hierarchy. As an ISV or Consultant, you might create a package for an industry, and then one or more packages for each business unit under that industry. As a best practice, you should have a single trigger and trigger handler class per object. This allows you to control the order in which trigger operations can occur. Let's say you use the package hierarchy below: The tricky thing here is, while you will want to install the industryCommon package for every customer, the same isn't true for the child packages. For a given customer, you might want to install businessUnit1, businessUnit2, or both. Given the package hierarchy above, it's not possible to have a single trigger on the Contact object. That is, until we leverage the power of Interfaces and the Type class. To implement apex best practices, we will need to create a single trigger and trigger handler class in the industryCommon package. When we are