
Explore Salesforce development and integration with over 60 practical coding examples, covering basic and advanced apex triggers, batch, dml, soql, lwc, and soap and rest integrations.
Sign up for a Salesforce developer edition at developer.salesforce.com/signup, create a username in the form of an email address, then follow the emailed login link to access your org.
Demonstrate how Apex triggers execute before or after DML operations, define trigger events, and use context variables to validate, update, and relate records such as accounts and contacts.
Implement a before delete apex trigger on the account object to prevent deletion when the active__c checkbox is true, using trigger.old and adding cannot be deleted errors.
Learn how to implement an after insert trigger on accounts that automatically creates a related contact, sets the contact's account id, and uses bulk-friendly insert with error handling.
Implement an after update Apex trigger on account to propagate description changes to related contacts. Bulkify by mapping account ids, querying contacts, and updating descriptions with error handling.
Implement an after delete Apex trigger to send email notifications when an account record is deleted, using messaging single email messages with subject and html body.
Explain how an after undelete Apex trigger updates account name and description using trigger.new, querying undeleted accounts, and performing a partial update with database.update(list, false).
Implement a before insert trigger that copies account description into the contact's description during creation, using a map of account ids and trigger.new data, with no update dml.
Create an Apex trigger on the contact object to validate before insert or update, enforcing birth date not in the future and phone required when lead source is phone inquiry.
Learn how to write an Apex trigger on contact for after insert and after update to create charter posts from feed items, with bulkification and proper parent id associations.
Demonstrates an after insert, after update Apex trigger on contact that creates a follow-up task when the contact has no related tasks; tests insert, update, and recreate after deletion.
Learn how an after update Apex trigger updates account descriptions when a contact description changes, using a parent-to-child query and a contact-to-account mapping.
Write an Apex trigger on the account object that updates the account description with the owner name on before insert and before update, using a map and owner lookup.
Prevent account deletion by using a before delete apex trigger that blocks accounts with related primary contacts and shows an error message when deletion is attempted.
Learn to implement an apex trigger on the contact object to prevent multiple primary contacts per account using before insert and before update logic, maps, and account-wide validation.
Learn how a before insert and before update Apex trigger fetches country ISO codes from a custom metadata type and populates the contact's ICAO code field.
Implement after insert, update, delete, undelete on opportunities to compute count, sum, min, max, and average of opportunity amounts on the related account using aggregate results and custom fields.
Explains one trigger per object design by routing account events through a trigger handler, covering before/after insert, update, delete and undelete, with description population and after insert contact creation.
Adopt a one trigger per object pattern using trigger operation type to handle before insert, before update, before delete, after insert, after update, and undelete.
Covers batch apex to update accounts with null descriptions, including start, execute, and finish methods, and updates via database.update, running through schedulable class or anonymous block.
Demonstrates building a stateful batch apex that updates account descriptions when null, tracks the update count with database.stateful, saves results, and sends a summary email using Messaging.SingleEmailMessage.
Master batch apex by deleting account records where the delete__c checkbox is true, using start, execute, and finish methods with a query locator and Database.delete in Salesforce.
Learn to schedule batch apex using the schedulable interface, execute batches with database.execute_batch, and configure weekly or daily schedules via the schedule apex UI.
Write Apex test classes using the @isTest annotation to validate Apex code and triggers, including bulk and single-record scenarios. Ensure 75% code coverage and use test data factories and assertions.
Write an Apex test class for a trigger that sets account rating to hot when industry is banking, otherwise cold. Use @isTest, start test, stop test, and assert equals.
Learn to build a public @isTest test data factory to create reusable test data for accounts, contacts, opportunities, and other objects, drive trigger logic, and achieve 100% code coverage.
Learn to write a batch apex test class that updates account descriptions when null, create 200 accounts, run the batch, and verify results with assertions and 100% code coverage.
Learn how to write an Apex test class for an Apex trigger that prevents deleting accounts with a related primary contact, validating the error message and achieving full code coverage.
Write an Apex test class for an Apex trigger, covering insert, update, and delete scenarios on opportunities, and verify roll-up summary values (sum, max, min, average, count) on accounts.
Explore Salesforce to Salesforce integration with soap inbound and outbound web services across two orgs, using wsdl, apex classes, a wrapper class, and future callouts to sync accounts.
Learn to build a rest inbound web service in Salesforce to create account records, test it with Workbench, and use wrapper classes for request and response data.
Learn rest callouts in apex to integrate external systems, using http requests and deserializing json to account records saved in Salesforce. Add remote site settings before callouts.
Learn the basics of SOQL, the SQL-like Salesforce query language, including select statements, where clauses, order by, limit, offset, group by, and having in Apex and Developer Console.
Explore SOQL aggregate functions, including avg, average, count, min, max, and sum, using group by and without it, with examples on opportunities and accounts in the developer console.
Master relationship queries in Salesforce SOQL, fetching child to parent and parent to child data in a single query, with subqueries on accounts and contacts.
Explore how to use SOQL date literals to filter query results, distinguishing between specific dates and relative ranges like today, this week, last 90 days, and this year.
Learn how to use bind variables in SOQL queries to safely pass values, with hands-on examples of preparing, colon-notation, and debugging in the developer console.
In this course, you will learn below topics. I have explained the triggers and batch apex classes from basics to advanced level. I have explained Salesforce Integration using REST and SOAP, SOQL, Lightning Web Components. These LWC, SOQL, Triggers Batch Apex Classes, Apex Web Services will help you to work in real-time projects and also will help you in clearing salesforce interviews.
I have provided the code for triggers, batch apex classes, SOAP, and REST Web Services, SOQL, LWC.
Basic Apex Triggers with 15 scenarios
Advanced Apex Triggers with 4 scenarios
One Trigger Per Object design pattern:
Apex Trigger with Trigger Handler with example - 1
Apex Trigger with Trigger Handler with example - 2
Batch Apex, Batch Apex - Database.Stateful with examples
Schedule Batch Apex
Apex Test Classes with 6 examples
Apex Test Class with Test Data Factory
Salesforce to Salesforce Integration using SOAP:
SOAP Inbound Web Service
SOAP Outbound Web Service
Salesforce Integration using REST:
REST Inbound Web Service
REST Callout
SOQL - Salesforce Object Query Language
SOQL - Basics
Aggregate Functions
Bind Variables
Child to Parent and Parent to Child Relationship Queries
LWC - Lightning Web Components
Decorators, Lifecycle Hooks, Record Form, Record Edit Form, Record View Form
Call Apex Methods using Wire, Imperative
LWC Communication from Child to Parent, Parent to Child, communication between unrelated Components
Apex Code to Create, Update, Delete, Undelete records.