Posts

Javascript Essential for Salesforce Developer

Event in JS An event listener is a JavaScript function that will be called when the specified event occurs on the element. There are many different types of events in JavaScript, such as mouse events (click, mouseover, etc.), keyboard events (keypress, keydown, etc.), and form events (submit, change, etc.). Event Listener To attach an event listener to an element, you use the addEventListener() method, available on all DOM elements. The first argument to addEventListener() is the type of event you want to listen for (e.g., "click", "submit", "load"), and the second argument is the function that should be executed when the event occurs. For example: var button = document.getElementById("myButton"); button.addEventListener("click", function() { alert("Button was clicked!"); }); var button = document.getElementById("myButton"); button.addEventListener("click", function() { alert("Button was clicked!...

Important Objects in Salesforce

Lead - Lead - Lead object is used to store information about a person interested in the product or service we are delivering.In business term lead are the potential customer. Lead Conversion means qualifying a lead to the sales process. Lead Management is a process that allow us to measure and monitor lead conversion. Important field of Lead Object - Company - Name of the company with which lead is affiliated. Title - Position of lead within his/her company. Lead Status - Open,Contacted,Working,Closed-Converted or Closes - Not Converted Lead Source - eg - web,purchased list,partner refferal Important fields in lead - Lead-->Company,LastName,status Related list of Lead - Campaign History - Campaign and Leads are related through a junction Object.i.e - Campaign Member Campaign History related list describe that in which campaign this particlular lead has been added as a member and also it's status for that campaign .When we initially create a lead record and add the campaign throu...

Basic Unix Commands Every Developer Should Know

Basic Unix Commands Every Developer Should Know BASIC UNIX EVERY DEVELOPER SHOULD KNOW Basic Unix Commands Every Developer Should Know A compact reference to the most useful Unix commands for developers and Salesforce engineers. Copy, paste, and practice these commands directly in your terminal. For Salesforce & backend developers Beginner friendly Works on macOS & Linux Unix commands help you move faster in projects, debug issues, and work with repositories without relying only on a GUI. If you are a Salesforce, backend, or full-stack developer, knowing these basics will save you a lot of time in the terminal. Below is a simple one-page guide you can use as a quick reference while working. Quick Command List pwd ls ...

Unix Command Line Basics for Salesforce Developers: The Complete Beginner’s Guide (With Examples & Essential Commands

Essential Unix Commands Every Salesforce Developer Should Master in 2025 🚀 If you're a Salesforce developer working with SFDX CLI , deploying metadata, or simply navigating your local project files, understanding Unix commands isn't optional—it's essential. Whether you're on Mac, Linux, or using Windows Subsystem for Linux (WSL), these commands will supercharge your productivity and make your Salesforce development workflow smoother. In this comprehensive guide, you'll learn the must-know Unix commands for Salesforce developers in 2025 , from basic navigation to Salesforce-specific SFDX workflows, complete with practical examples you can use today. Table of Contents Understanding the Foundation: What You Need to Know The Essential Unix Commands Every Developer Needs Salesforce-Specific Unix & SFDX Commands Quick Reference Cheat Sheet Combining Commands for Powerful Workflows Common Mistakes to A...

How to handle click outside in Lightning Web Components || How to Hide a Dropdown in LWC When User Clicks Outside

LWC Outside Click Detection: Two Proven Methods LWC Outside Click Detection: Two Proven Methods for Dropdown Management When building Lightning Web Components with dropdown functionality, detecting clicks outside the component to close dropdowns is a common requirement. Here are two battle-tested approaches that actually work. Method 1: Conditional Event Listener (Recommended) Best for: Components with multiple states (mobile menus, complex dropdowns) export default class MyComponent extends LightningElement { boundHandleOutsideClick = null; isDropdownOpen = false; connectedCallback() { this.boundHandleOutsideClick = this.handleOutsideClick.bind(this); } handleOutsideClick(event) { console.log('Outside click detected'); const container = this.template.querySelector('.dropdown-container'); if (container && !container.contains(event.target) && this.isDro...

Essential JSON Handling in Salesforce (Apex + LWC)

Essential JSON Handling in Salesforce (Apex + LWC) Essential JSON Handling in Salesforce (Apex + LWC) 1. JSON Handling in Apex A. Convert Apex Objects to JSON ( JSON.serialize() ) Serialization means converting an Apex object to a JSON string . public class Student { public String name; public Integer age; public Student(String name, Integer age) { this.name = name; this.age = age; } } // Convert Apex object to JSON string Student s = new Student('John', 23); String jsonString = JSON.serialize(s); System.debug('JSON Output: ' + jsonString); Output: {"name":"John","age":23} B. Convert JSON to Apex Objects ( JSON.deserialize() ) String jsonInput = '{"name":"John","age":23}'; Student parsedStudent = (Stu...

OOPS in Apex

Object-Oriented Programming (OOP) in Apex: Complete Guide Object-Oriented Programming (OOP) in Apex: Complete Guide 1. Encapsulation Definition : Bundling data (properties) and methods (behaviors) into a single unit (class) while restricting direct access to some components. Purpose : Protect data integrity and control access via methods. public class BankAccount { private String accountNumber; private Decimal balance; public void deposit(Decimal amount) { if (amount > 0) balance += amount; } public Decimal getBalance() { return balance; } } Key Points : Use private variables to hide data. Expose controlled access via public methods. 2. Classes and Objects Class : Blueprint for creating objects (e.g., BankAccount ). Object : Instance of a class (e.g., BankAccount acc = new...