In the Apex class, I’ve used Apex Cursors for handling a large volume of records efficiently. The class processes records in chunks of 200 per Queueable transaction. When fewer than 200 records remain, the batch size automatically adjusts to match the remaining count.
This class retrieves all U.S. Contact records and updates the Citizenship_Status__c field to “US Citizen.”
SF Crunch Posts
This article walk you through to securely connect to external APIs using bearer tokens in Salesforce, using the External Credentials to store the token and configure Named Credentials to pass it in API requests. After setup, register the external service using an OpenAPI schema to make its actions available in Flow Builder for automation.
This article demonstrates how to build a Lightning Web Component (LWC) that dynamically displays picklist values based on the selected record type and controlling picklist value, without using any Apex code. The component retrieves picklist values directly from the field definitions using Lightning Data Service, ensuring that nothing is hard-coded.
For illustration, the example uses the Opportunity object with two record types and two custom picklist fields: Solution_Type__c (controlling field) and Product_Type__c (dependent field).
In Salesforce, you cannot directly trigger a Flow or Apex Trigger when a Sales Engagement Cadence is completed, because Salesforce does not expose a native “Cadence Completed” event or field out-of-the-box that Flows or Apex can monitor.
However, you can work around this limitation depending on what your goal is. Here is an overview of the solution using Change Data Capture and Apex trigger on CDC event:
This article demonstrates a workaround of the limitation of LWC for displaying the HTML content retrieve through the external API endpoint.
I used Visualforce Page to render the RAW HTML using an iframe of the child VF page. This approach ensures that when the page loads, the HTML is retrieved directly from the API and rendered correctly in the browser, without being affected by LWC’s content security restrictions.
When using Data Tables in Salesforce Screen Flows, there’s a common limitation that the table doesn’t support clickable links or showing field values from lookup relations directly.
In this article, I demonstrate a simple workaround for this limitation without creating any extra fields in Salesforce.
For example, I’ve created a Flow that shows all related Cases for an Account in the data table. The datatable display the Case Number and the Contact column as clickable column and also display the contact name instead of its Id.
Local Dev runs a real-time preview of the Lightning app on your local machine. Local Dev detects source code changes and automatically refreshes Lightning apps, speeding up development time. STEP 1:To enable this feature in your Salesforce org, navigate to Setup > Local Development, and toggle Local Development to Enabled…
You can easily format/align Apex code directly in the Developer Console.
The Apex code illustrates how to generate XML containing Account information and its related Contacts. It includes the Account details in the root tag and adds the Contacts within a
When sending an email using a template in Apex, the “targetObjectId” is typically required, which must be the ID of a Lead, Contact, or User. However, in many cases, you may not have a targetObjectId available, especially when sending an email from a custom object to an external email address that isn’t associated with a Lead, Contact, or User in Salesforce.
Many articles suggest creating a dummy Contact record to use as the targetObjectId, but this workaround can be cumbersome and unreliable.
Here’s a more effective solution that avoids the need for a dummy Contact. See the sample code in article.
When using the Send Email core action in Salesforce Flow to send an email with a rich-text body. Switching between plain text and rich text in the template editor alters the HTML markup, resulting in incorrect rendering and formatting issues.
To avoid this, use a plain text template with HTML markup and select Rich-Text-Formatted Body as true in the Send Email action. This approach ensures the email body is formatted correctly. See the attached screenshots for reference.
The article explains converting the current DateTime to a specific time zone using Apex code and then converts it to a string without altering it to the user’s local time zone. The string DateTime is then parsed into separate variables to extract the date and time components.
This article demonstrates automatically refreshing dashboards using apex scheduled job that you can plan to run at specific times.
It uses a custom setting to store the dashboard Ids then a scheduled job to get all dashboard Ids from the custom setting and refresh the dashboard at specific time or multiple times a day.
This article explains how to use Salesforce Screen Flow to open a record in a console sub-tab. By creating a text template that includes the record’s ID and using a display text component, users can click a link that opens the record within the console rather than a new browser tab. Two key steps are involved: (1) creating the text template with the record ID, and (2) displaying the template in the flow using the “Display Text” component.
This articles leverages a lightning web component to export the data from Salesforce screen flow. The LWC inputs a collection variable and convert it into a CSV file. Moreover, you also have options to select an sObject and fields to be exported into the CSV file.
This article walk you through using the Slack API within Salesforce Apex. This contains an example of unarchiving the Slack channel using API: https://api.slack.com/methods/conversations.unarchive
This article has two apex invocable actions that can be invoked from the flow and other apex classes.
This class can be used in flows to send emails programmatically without needing predefined email alerts.
It allows customization of email content, recipients, and attachments on the fly. The Apex class is designed to send emails from Salesforce without the need for an Email Alert.
This article shows, how to preview an email in a screen flow with actual merge fields populated before sending it out to a customer, ensuring all details are correct. By using an Apex invocable action that returns email body with all the merge fields populated and in the screen flow show text using display text component and HTML body using an LWC.
A Salesforce formula that returns a date. It evaluates the first day of the next month based on the current date.
In this article, I introduce some user management features in Salesforce such as user access policies, view summaries of users, and permission sets. These features are either recently introduced or going to be generally available in the summer 24 release. I provide a step-by-step demonstration of how to enable and use the user access policy feature, which allows you to manage the assignment of permission sets, public groups, and queues to users. I also showcase the view summary feature, which displays all the permissions assigned to a user or a permission set on a single page. No action is requested from the viewers, but this video aims to provide valuable information about these user management features.
This article provides a workaround for an issue encountered with the BR() function in Salesforce flow formulas. Instead of generating a line break, the BR() function outputs the br tag.
a formula field that calculates a date 30 days from today and ensures that the date does not fall on a weekend. If the calculated date lands on a Saturday or Sunday, the formula returns the following Monday.
This article provides step-by-step instructions to help you set up an automation using Change Data Capture, Flow and Apex trigger to update the lead Owner, when a lead is assigned to a Specific cadence. The apex trigger listens for new events on the ActionCadenceTrackerChangeEvent object, and when a Lead is targeted by a specific cadence (‘my test cadence’), it triggers a Flow to update the lead owner with the cadence assignee.
This article walk you through creating an Apex class which is used to send a summary of open tasks to each active standard user in Salesforce, helping them stay informed about their pending tasks. The email is sent from a specified org-wide email address, and the tasks are listed in a table format within the email.
An example of LWC to display CMS Content (Collection) as an accordion on a public Lightning Web Runtime (LWR) site, leveraging the ConnectAPI.ManagedContentDelivery class. In this example, I use the getCollectionItemsForChannel method from the ConnectAPI.ManagedContentDelivery class to retrieve CMS Collection items and display them as an accordion.
The following article demonstrates exposing the apex class as a REST web service for creating a lead record in Salesforce. It is designed to handle HTTP POST requests containing lead data in JSON format.
This Lightning Web Component (LWC) provides a seamless UTM builder functionality, enabling users to effortlessly generate UTM parameters for their marketing links. UTM, which stands for Urchin Tracking Module, is a set of query parameters added to URLs for tracking the effectiveness of online marketing campaigns.
This article illustrates creating a lightning web component to export opportunities to a CSV file with a simple button click directly from the account detail page. This solution eliminates the need for Apex code, opting instead for the utilization of the getRelatedListRecords wire adapter.
This article walks you through to process apex trigger records in less than 200 records per transaction using queueable chaining apex job to avoid Salesforce limitations.
Consider a situation where you are bulk inserting records into a custom object or standard object, and you have an Apex trigger that is fired by this custom object. This trigger contains complex business logic, and you’re running into Salesforce limitations due to processing the default batch size of 200 records in a single transaction.
