Create a hand-on example as pass input value from parent to child component through PubSub Model LWC in Salesforce

In Lightning Web Components (LWC), the PubSub model is used when we want to communicate between components that are not directly related (not parent-child or sibling). But for learning purposes, we can create a simple Parent → Child communication using PubSub so beginners understand how the publish–subscribe pattern works. Below are the steps for a … Read more →

How to pass input value from parent to child component through LMS method in Salesforce | Hand-on example as pass input value from parent to child component through Lightning Message Service (LMS) in Salesforce

Hand-on example as pass input value from parent to child component through Lightning Message Service (LMS) in Salesforce In Salesforce Lightning Message Service (LMS), we normally use it for communication between unrelated components (not directly parent–child). But for learning purpose, we can still create a simple example where: Parent Component publishes a message Child Component … Read more →

Apex Trigger Whenever Case is: Inserted/Updated/Deleted/Undeleted We need to count Cases based on Priority: High, Medium, Low And update counts on Account

Apex Trigger Whenever Case is: Inserted/Updated/Deleted/Undeleted We need to count Cases based on Priority: High, Medium, Low And update counts on Account   Step 1 Create Fields on Account Create 3 Number fields: Field Label API Name High Priority Cases High_Priority_Cases__c Medium Priority Cases Medium_Priority_Cases__c Low Priority Cases Low_Priority_Cases__c Data Type → Number (0 decimal) … Read more →

Apex Trigger Whenever Opportunity is Inserted/Updated/Deleted/Undeleted We need to count how many Opportunities have: StageName = ‘Closed Won’ And update that count on Account.

Apex Trigger Whenever Opportunity is Inserted/Updated/Deleted/Undeleted We need to count how many Opportunities have: StageName = ‘Closed Won’ And update that count on Account.   Step 1 Create Fields on Account Create Number field on Account: Field Label API Name Closed Won Opportunities Closed_Won_Count__c Data Type → Number (0 decimal)   Logic (Same Clean Pattern) … Read more →

When an Account’s field Share_With_User__c (a lookup to User) is filled, automatically share that Account with that user via Apex sharing.

Apex Trigger to When an Account’s field Share_With_User__c (a lookup to User) is filled, automatically share that Account with that user via Apex sharing in Salesforce To automatically share an Account with a user when a lookup field (Share_With_User__c) is populated, you must use Apex Managed Sharing via an Apex Trigger. Because the Account is … Read more →

Add Multiple Rows button (Dynamic Contact Rows) Bulk Insert Contacts Related to Account using Database.insert() in LWC Salesforce

Add Multiple Rows button (Dynamic Contact Rows) Bulk Insert Contacts Related to Account using Database.insert() Single LWC (No child component) in LWC Salesforce SCENARIO User will: Enter Account details Click Add Contact Row (can add multiple contacts) Fill contact details

Create multiple Contacts in Salesforce Using a Lightning Web Component (LWC) Calling an Apex method Using Database.insert for bulk record insert and Displaying success & error messages

Scenario We want to create a form in LWC where the user enters First Name, Last Name, and Email for each contact and clicks Create Contacts button to insert multiple Contact records at once. Step-by-Step Implementation Apex Class — Bulk Insert Contacts   ContactBulkInsertController.cls → Step 1:- ContactBulkInsertController.cls ContactBulkInsertController.cls [Apex Controller] 🚀 Get Source Code … Read more →

Apex Trigger Whenever a Contact is updated (Email / Phone), Salesforce calls external REST API again using Queueable Apex | Salesforce sends Contact data using POST REST API using Queueable Apex

Apex Trigger Whenever a Contact is updated (Email / Phone), Salesforce calls external REST API again using Queueable Apex | Salesforce sends Contact data using POST REST API using Queueable Apex REAL-TIME BUSINESS SCENARIO (POST + QUEUEABLE) 📌 Scenario Salesforce has Contacts not yet synced with an External CRM Salesforce sends Contact data using POST … Read more →

Apex Trigger to Sends Contact data to external system using POST API, External system returns External Customer ID, Salesforce updates Contact with External ID Using Batch Class in Salesforce

Apex Trigger to Sends Contact data to external system using POST API, External system returns External Customer ID, Salesforce updates Contact with External ID Using Batch Class in Salesforce REAL-TIME BUSINESS SCENARIO (POST + BATCH) 📌 Scenario: Salesforce has Contacts that are not yet synced with an External CRM A Batch Apex job: Sends Contact … Read more →

Salesforce sends Contact data to an External CRM System using POST REST API, External system returns a Customer Reference ID, salesforce stores that ID in a custom field, Whenever Contact Phone or Email is updated, Salesforce notifies the external system Use @future method

Salesforce sends Contact data to an External CRM System using POST REST API, External system returns a Customer Reference ID, Salesforce stores that ID in a custom field, Whenever Contact Phone or Email is updated, Salesforce notifies the external system Use @future method Real-Time Business Scenario: Salesforce sends Contact data to an External CRM System … Read more →