Tag Archives: #DML

Salesforce Apex Utility Class for Non-Working Days and Shipping Date Calculation

Introduction In real-world business operations, ensuring that shipments are scheduled only on working days (Monday–Friday, excluding holidays) is crucial. If an order is scheduled to ship on a weekend or holiday, the system should automatically adjust it to the next valid business day. This blog explains an Apex utility class that helps determine whether a […]

Understanding Salesforce Files and Efficient Querying

Introduction Salesforce stores files using several key objects: ContentVersion, ContentDocument, ContentDocumentLink, ContentDocumentFeed, and ContentDocumentHistory. However, in most use cases, we primarily work with the first three—ContentVersion, ContentDocument, and ContentDocumentLink. What Are These Objects? Relationship Among These Objects Efficient vs. Inefficient Querying Inefficient Approach If you want to retrieve ContentVersion details of a record, a common […]

All About “MIXED_DML_OPERATION” error (Setup and Non-setup Object)

IntroductionSalesforce developers often encounter Mixed DML exceptions, but there’s confusion around when they occur. A common myth is that updating setup and non-setup objects in the same transaction triggers this error. Let’s debunk this myth and clarify best practices for writing efficient Apex code. What is a Mixed DML Exception? In Salesforce, setup objects (e.g., […]

This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.