addError() Method in Salesforce Apex

addError() Method in Salesforce Apex

We create validation rules in Salesforce to show errors on the record detail page. When a user enters incorrect data, the validation rule stops the save and displays an error message. But when working with Apex, sometimes validation rules are not enough. For example, we need to use Apex code to check complex conditions or … Read more >>>

String Class Methods in Salesforce Apex

String Class Methods in Salesforce Apex

When we work on strings in Apex, we often take inputs like names, emails, or messages from forms or records. For example, suppose you’re building a custom form where users enter their full name and email. Before saving this data to Salesforce, you want to ensure everything looks good. You need to check that the … Read more >>>

Trigger Context Variable in Salesforce Apex

Trigger Context Variable in Salesforce Apex

In Salesforce, we use Flows and Triggers to automate any process. To define when the flow should be executed, we can select the flow execution condition, such as record creation, update, deletion, etc. If you have a complex process and want to automate it, you need to use the Apex trigger. Here, also, we need … Read more >>>

Assign Tasks in Salesforce Using Apex

Assign Tasks in Salesforce Using Apex

Usually, when we want to assign a task to users or a queue, we do it manually from the record detail page. But what if I told you we can automate this task assignment process using a Salesforce Apex class? Yes, with Apex, we can write logic to automatically assign tasks to specific users or … Read more >>>

Trigger Handler Pattern in Salesforce Apex

Apex Trigger Helper Class in Salesforce

Usually, when we write the Apex Triggers, we write the trigger class and also implement the logic in the same class. Let’s say you created a trigger to automate the process of updating fields on the Account object when a specific condition is met. Now, again, you need to automate any other processes on the … Read more >>>

How to Clone the Record With Related List in Salesforce

Clone Related list in Salesforce

To create similar records in Salesforce, we have an option to clone that specific object record using the Clone quick action. But it does not clone child records in a master-detail relationship, such as an Opportunity that has Opportunity Products and Quotes. In the Accounts object, you will get the option to clone the related … Read more >>>

Virtual Class in Salesforce Apex

Virtual Class in Salesforce Apex

In object-oriented programming, we extend the parent class to reuse code and add new features in the child class without rewriting everything from scratch. This is what we call inheritance. In Java, when we need to inherit from any class, we need to use the extends keyword to create the child class. However, in Salesforce … Read more >>>

Salesforce Apex With, Without, Inherited and Omitted Sharing

Implement with sharing in Salesforce Apex

In a Salesforce Apex class, we can define the sharing settings to control data access and ensure security within the Salesforce platform. To manage how Apex classes follow record-level access, we use keywords such as with sharing, without sharing, inherited sharing, and omitted sharing in Salesforce Apex. In this blog, we’ll learn what each of … Read more >>>

Send An Email to User and Public Group Using Apex in Salesforce

How to Send Email to User Using Apex in Salesforce

In Salesforce, we have a flow automation feature that allows us to automate processes such as record updates, task assignments, creation of related records, and sending automated emails. However, we can use Salesforce Apex when the logic is complex or when working with a large number of records. Triggers are written in code, which provides … Read more >>>

Salesforce DML Before and After Callout

Salesforce DML Before and After Callout

In Salesforce, when making a callout (an external API request), you must carefully handle DML(Data Manipulation Language) operations due to governor limits and transaction restrictions. In this tutorial, we will learn about Salesforce DML before and after a callout. In that, I will explain what a callout in Salesforce is and why DML before a … Read more >>>

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.