If you’ve been working in a Salesforce DX project for a while, you might notice that running sf project deploy start begins to feel sluggish. Sometimes, it stays stuck at “Polling for status” or “Initializing” for minutes before any actual progress occurs. Recently, I encountered this exact issue. After trying a few different angles, theContinue reading “Dealing with Slow Salesforce Deployments? Try Resetting Your Source Tracking”
Category Archives: Uncategorized
Zero-Friction Pomodoro Timer (By Sandy) with Voice Assistant
Stop battling distractions and start working instantly! This Cyclical Pomodoro Timer (By Sandy) is the ultimate productivity tool designed to minimize setup and maximize your focus time. 🚀 Why You Need This Timer (Key Benefits) ✨ Key Features at a Glance 💡 How to Use It Install the Zero-Friction Pomodoro Timer (By Sandy) today andContinue reading “Zero-Friction Pomodoro Timer (By Sandy) with Voice Assistant”
🔍 Understanding Where Salesforce (SFDX) Environments Are Stored in VS Code
When you’re working with Salesforce DX (SFDX) in Visual Studio Code, you often connect to multiple Salesforce orgs — such as Developer Orgs, Sandboxes, or Scratch Orgs.But have you ever wondered where these environments are actually stored? Let’s break it down in simple terms 👇 🧩 What Are Salesforce (SFDX) Environments? In SFDX, “environments” referContinue reading “🔍 Understanding Where Salesforce (SFDX) Environments Are Stored in VS Code”
Download Recent Salesforce Debug Logs Using Salesforce CLI
Debug logs are an essential tool for Salesforce developers and admins. They help trace code execution, identify issues, and monitor system behavior. While you can view logs directly in Salesforce Setup, downloading multiple logs at once can be tedious. Thankfully, the Salesforce CLI (sf) makes this process quick and easy. Using sf apex get logContinue reading “Download Recent Salesforce Debug Logs Using Salesforce CLI”
Simple Timer (By Sandy): A Chrome Extension That Talks to You
Need a timer that not only tracks time but also alerts you audibly? Meet Simple Timer (By Sandy) — a lightweight Chrome Extension that counts down and speaks “Time’s up!” when your session ends. No more staring at the screen! Why This Extension? Many timers silently finish, and you might miss them while working, studying,Continue reading “Simple Timer (By Sandy): A Chrome Extension That Talks to You”
How to Perform a Git Hard Pull (Without Regret)
When collaborating in Git, it’s not uncommon to find your local branch out of sync with the remote—especially when you’ve made changes that conflict or aren’t needed anymore. If you just want to wipe your local changes and sync exactly with the remote, there’s a powerful (but dangerous) combo: git reset –hardgit pull In thisContinue reading “How to Perform a Git Hard Pull (Without Regret)”
Cleaning Up Test Data Efficiently Using a Batch Apex Job in Salesforce
✅ Problem Statement (Refined & Expanded) In many Salesforce development or QA environments, repeated testing often leads to the creation of thousands of test records across multiple objects. Whether you’re testing a data import process, automation rules, integrations, or user journeys — each test run leaves behind a trail of test data. Over time, thisContinue reading “Cleaning Up Test Data Efficiently Using a Batch Apex Job in Salesforce”
Streamline your File Management Operations in Salesforce
Finding the time to manage your files in Salesforce can feel like a juggling act – especially when you keep your business running while dealing with multiple documents, attachments, and data across different departments. What if there was a way to streamline your file management operations, cut clutter, and keep everything in one easy-to-find place?Continue reading “Streamline your File Management Operations in Salesforce”
How to retrieve all debug logs using git bash
How to generate private key and certificate
When working with SSL/TLS and securing communications, it is essential to generate a private key and certificate. OpenSSL is a powerful and widely-used toolkit for managing these cryptographic tasks. Below, I’ll walk you through the process of generating a private key and a self-signed certificate using OpenSSL. Step 1: Install OpenSSL If you don’t haveContinue reading “How to generate private key and certificate”
Important Financial Ratios and Interpretations for Stock Valuation
Here is a table summarizing important financial ratios, their formulas, and interpretations: Ratio Formula Interpretation Price-to-Earnings (P/E) [ \frac{\text{Market Price per Share}}{\text{Earnings per Share (EPS)}} ] A low P/E ratio compared to industry average may indicate undervaluation; suggests how much investors are willing to pay per dollar of earnings. Price-to-Book (P/B) [\frac{\text{Market Price per Share}}{\text{BookContinue reading “Important Financial Ratios and Interpretations for Stock Valuation”
Salesforce Sales Cloud Certification Guide: Key Concepts and Best Practices
Welcome to your comprehensive guide for Salesforce Sales Cloud Certification. This set of notes is designed to help you master the key concepts and functionalities required to pass the Salesforce Sales Cloud certification exam. The certification focuses on various aspects of Salesforce Sales Cloud, including industry knowledge, implementation strategies, solution design, marketing and leads management,Continue reading “Salesforce Sales Cloud Certification Guide: Key Concepts and Best Practices”
How to create video recorder application in salesforce using lwc
Creating a video recorder application in Salesforce using Lightning Web Components (LWC) involves integrating with the browser’s native media capture API and leveraging Salesforce’s platform capabilities for storing and managing video data. Here’s a high-level overview of how you can implement this: Set Up Lightning Web Components (LWC): Accessing Media Capture API: Recording Video: StoringContinue reading “How to create video recorder application in salesforce using lwc”
Setting up vs code with bitbucket
Create a folder for your code and open git bash inside this folder by clicking right click like this- Get clone by clicking on clone button like this and paste in git bash and press enter- project folder will be created inside your local branch folder. Now move to this project folder using below command-Continue reading “Setting up vs code with bitbucket”
Most Used Git commands using Bitbucket
Most Used Git Commands- Setting User Name Setting Email Setting Code Editor To see global git configuration Creates a brand new Git repository. Adding a remote repository To check all the branches To check what branch we are currently on To check status of current working branch To stage specific file To stage all files Commit withContinue reading “Most Used Git commands using Bitbucket”
LWC : How to set default values when you clone a record?
Problem: Currently we have no standard way to populate default values while cloning records in salesforce. For eg. If I want to clone a Case record, I have a requirement to set Status field as Open on UI while cloning. Approach: We will be using create new record page feature of lwc to implement thisContinue reading “LWC : How to set default values when you clone a record?”
How to align contents vertically in html?
HTML CSS3: Note:
Install Visual studio code and create a lwc component
You need CLI for VsCode, so let’s install the CLI before we install visual studio code- Install the Command Line Interface (CLI) Install Visual Studio Code (VsCode) We have installed cli and vscode. Now we need to create project first in vscode before creating a lwc component. So, lets create a project first and authorizeContinue reading “Install Visual studio code and create a lwc component”
Web Server Flow using PKCE (Salesforce/SFDC)
Problem Statement: We get authorization code in the callback url and hacker can intercept the auth code and this way, without user’s knowledge, he can get access token and then salesforce resources if he has access to connect app’s client and client secret. Solution: Salesforce recommends web server flow with Proof Key for Code forContinue reading “Web Server Flow using PKCE (Salesforce/SFDC)”
Send Custom Bell/Push Notification (LWC)
sendCustomNotification.html sendCustomNotification.js sendCustomNotification.js-meta.xml CustomNotificationFromApex NotificationWrapper
Building Resilient Integration in case error occurs during execution of batch Apex Class
When you are integrating with external system using Batch Apex, you can implement Database.RaisesPlatformEvents interface to generate BatchApexErrorEvent event which external system can subscribe to listen in case of error. Streaming API Subscription Channel: /event/BatchApexErrorEvent Example: Listening to the event using trigger: Test Class: Note: Please don’t forget to use ‘Test.getEventBus().deliver();’ to fire platform eventContinue reading “Building Resilient Integration in case error occurs during execution of batch Apex Class”
Salesforce Chat Agent (Advanced)
This blog assumes you have basic understanding of chat agent configurations. So once you have created ‘Embedded Service Deployments’, you have to ‘Chat Code Snippet share it to the customer portal. Now there is below requirement- For Available Chat Agents- New Contact should not be created. Contact should be searched based on combination of firstContinue reading “Salesforce Chat Agent (Advanced)”
Display Alert when Laptop is fully charged
You can display standard warning message when your laptop battery becomes low beyond threshold level but reverse is not true. It would be better if there would be in-built solution to display warning when laptop battery becomes full so that we can switch-off the power button which would increase the laptop battery life. Since thereContinue reading “Display Alert when Laptop is fully charged”
Check Salesforce organization limits and usage using Workbench
Ensure you are logged into the organization where you want to verify your limits. Navigate to: https://workbench.developerforce.com/login.php Accept any oauth prompts to complete authentication On the ‘Jump to’ picklist select REST Explorer. Click Select. From the options presented select: /services/data/vXX.0/limits Click Execute. Select the SingleEmail area to view the daily maximum and remaining calls. Reference:Continue reading “Check Salesforce organization limits and usage using Workbench”
Basics of Salesforce CPQ
What is Salesforce CPQ? CPQ stands for configure, price, and quote. A quality quote is the end product of Salesforce CPQ. Using Salesforce CPQ, you can choose products smartly, configure its price (You just need to set the percent discount, CPQ with do the math) and generate a nice pdf for your customer quickly andContinue reading “Basics of Salesforce CPQ”
CSS Tricks
align-items: center -> align all the items in the center of the screenjustify-content: space-between -> items are evenly distributed in the line; first item is on the start line, last item on the end linebackground-size: contain -> fit the size of the image within parent container.Let’s know bit more->The justify-content property is a sub-property ofContinue reading “CSS Tricks”
Creating LWC project using CLI
Step 1. Create a new Salesforce project with this commandsfdx force:project:create -n projectName Step 2. Navigate to the directory with this commandcd projectName Step 3. Authorize an org with this commandsfdx force:auth:web:login -s -a projectName In this step, browser will open, you need to enter credentials to authorize your org with this project. You can closeContinue reading “Creating LWC project using CLI”
ScrollToTop button example
Use cases-1. When you scroll to the bottom, ‘scroll to top’ button will be visible.2. When you will click on that ‘scroll to top’, button, you will be navigated to the top. Please find the sample code- SampleScrollToBottomTop.html JQuery | Detecting when user scrolls to bottomContinue reading “ScrollToTop button example”
Build an Aura Component to Override a Standard Action
Topics to learn-1. How to populate picklist values in a field.2. How to use modal to show popup3. Use of slds-backdrop class4. How to use LDS (lightning data service) to create/edit a record. Please refer the below code to learn the above topics- PropertyDialog.cmp <force:recordData aura:id="forceRecord" Continue reading “Build an Aura Component to Override a Standard Action”
LWC publish subscribe model
To understand this concept, please go through this trailhead-https://trailhead.salesforce.com/content/learn/projects/lwc-build-flexible-apps/inter-comp-events?trail_id=build-lightning-web-components pubsub.js /** * A basic pub-sub mechanism for sibling component communication * * TODO – adopt standard flexipage sibling communication mechanism when it’s available. */ const events = {}; const samePageRef = (pageRef1, pageRef2) => { const obj1 = pageRef1.attributes; const obj2 = pageRef2.attributes; return Object.keys(obj1) .concat(Object.keys(obj2)) .every(key => { return obj1[key] === obj2[key]; }); }; /** * Registers a callback for an event * @param {string} eventName – Name of the event to listen for. * @param {function} callback – Function to invoke when said event is fired. * @param {object} thisArg – The value to be passed as the this parameter to the callback function is bound. */ const registerListener = (eventName, callback, thisArg) => { // Checking that the listener has a pageRef property. We rely on that property for filtering purpose in fireEvent() if (!thisArg.pageRef) { throw new Error( ‘pubsub listeners need a “@wire(CurrentPageReference) pageRef” property’, ); } if (!events[eventName]) { events[eventName] = []; } const duplicate = events[eventName].find(listener => { return listener.callback === callback && listener.thisArg === thisArg; }); if (!duplicate) { events[eventName].push({ callback, thisArg }); } }; /** * Unregisters a callback for an event * @param {string} eventName – Name of the event to unregister from. * @param {function} callback – Function to unregister. * @param {object} thisArg – The value to be passed as the this parameter to the callback function is bound. */ const unregisterListener = (eventName, callback, thisArg) => {Continue reading “LWC publish subscribe model”
Make Long-Running Callouts with Continuations
Use the Continuation class in Apex to make a long-running request to an external Web service. Process the response in a callback method. An asynchronous callout made with a continuation doesn’t count toward the Apex limit of 10 synchronous requests that last longer than five seconds. To make a long-running callout, define an Apex method that returnsContinue reading “Make Long-Running Callouts with Continuations”
Show Toast messages in Visualforce pages
function showToastMessage() {showToast(‘Error!’, ‘Failure Message’, ‘error’);} function showToast(title, message, type) {sforce.one.showToast({“title”: title,“message”: message,“type”: type});}
Resolution for SVG rendering issue on visualforce page
Issue: Using tag to get SLDS Icons in vf. Initially on page load all works fine but when I try to re-render any that have icons inside it, on complete of rerendering it vanish my all icons. Resolution: I was able to overcome the problem of SVG images disappearing using following steps- -Add docType=”html-5.0″ attributeContinue reading “Resolution for SVG rendering issue on visualforce page”
Convert old Notes into Enhanced Notes using Apex
When you convert Old Notes to enhanced Notes, following must be kept in mind-1. CreatedDate/LastModifiedDate of the enhanced note must be same that of the old Note. Create a permission set for that. Follow the steps to create the same- From Setup, enter Permission Sets in the Quick Find box, then select Permission Sets. CreateContinue reading “Convert old Notes into Enhanced Notes using Apex”
Deleting Files related to a record
Sample Code: Set contentDocumentIds = new Set(); List cDocLink = [Select id, ContentDocumentId from ContentDocumentLink where LinkedEntityId = :ParentId]; for(ContentDocumentLink contentDocLinks : cDocLink)Continue reading “Deleting Files related to a record”
Converting attachment into file
When you convert attachment to File, following must be kept in mind-1. Filename should be without extension. It can be with extension but its better to without extension.2. CreatedDate/LastModifiedDate of the file must be same that of the attachment. Create a permission set for that. Follow the steps to create the same- From Setup, enterContinue reading “Converting attachment into file”
Mass action for Visualforce & lightning
We are deleting multiple records using mass action here. After deleting we are redirecting back to the same list view. Please follow following four steps to create mass action button- Step1. Create a extension with standardsetController Step2. Create a vf page with recordSetVar attribute Step3. Create a list button for this vf. Step4. Add thisContinue reading “Mass action for Visualforce & lightning”
How to navigate from one component to other component in lightning
We will use lightning:navigation component to navigate to other component. Please follow below steps for the same- Step 1. Add the lightning:isUrlAddressable interface to the component on which you want to navigate. for eg. {!v.dummyValue}. Step 2. Retrieve the attribute values from the page state. In below code, ‘c__dummyString’Continue reading “How to navigate from one component to other component in lightning”
Standard New and Edit functionality
public with sharing class ReadingPermissionController { public ReadingPermission__c newReadingPermission {get;set;} public String returnUrl {get;set;} public ReadingPermissionController(ApexPages.StandardController setCon) { ReadingPermission__c r = (ReadingPermission__c) setCon.getRecord(); newReadingPermission = new ReadingPermission__c(); if(r.Id != null) { newReadingPermission = [Select Id, Name, Permission_Holder_Name__c, Permission_Holder_ID__c, Permission_Holder_Type__c, Granted_Permissions__c from ReadingPermission__c where id =: r.Id]; } //system.assert(false, newReadingPermission ); returnUrl = apexpages.currentPage().getParameters().get(‘retURL’); } publicContinue reading “Standard New and Edit functionality”
Retriving datetime field value in yyyy-mm-dd hh:mm:ss format
You can use the format function to format the datetime in any format. Following example shows the created date retrieved in yyyy-mm-dd hh:mm:ss format. String createdDate = contactObj.CreatedDate.format(‘yyyy-MM-dd\’T\’hh:mm:ss\’z\”);
Creating Vf and Apex Class for Portal
Class- public with sharing class ReadingPermissionController { public ReadingPermission__c newReadingPermission {get;set;} public String returnUrl {get;set;} public ReadingPermissionController(ApexPages.StandardController setCon) { ReadingPermission__c r = (ReadingPermission__c) setCon.getRecord(); newReadingPermission = new ReadingPermission__c(); if(r.Id != null) { newReadingPermission = [Select Id, Name, Permission_Holder_Name__c, Permission_Holder_ID__c, Permission_Holder_Type__c, Granted_Permissions__c from ReadingPermission__c where id =: r.Id]; } //system.assert(false, newReadingPermission ); returnUrl = apexpages.currentPage().getParameters().get(‘retURL’); }Continue reading “Creating Vf and Apex Class for Portal”
Salesforce Interview Questions
How can we improve VisualForce Page Performance?Hint:- 1. Reduce view state2. Reduce load time3. Careful use of multiple concurrent requests4. Queries and security- using with sharing keyword5. Preventing field values from dropping off the page. For more information, please open following link-http://www.salesforce.com/docs/developer/pages/Content/pages_best_practices_performance.htm What is View state? How can we reduce this?Visualforce pages that contain aContinue reading “Salesforce Interview Questions”
How to work efficiently with DML statements in Apex class
The following Apex DML statements are available:InsertUpdateUpsertDeleteUndeleteMerge Salesforce allows only 150 DML statements for each Apex transaction. So its better to check the list against null or empty before performing DML operations. Example- Account a = new Account(Name=’Acme2′);insert(a);Account myAcct = [SELECT Id, Name, BillingCity FROM Account WHERE Id = :a.Id];myAcct.BillingCity = ‘San Francisco’; try {Continue reading “How to work efficiently with DML statements in Apex class”
Maintaining Width of multi-picklist on visualforce page in Salesforce
Use following javascript code $(document).ready(function(){ $(“[id*=’_unselected’]”).dblclick(function(){ setTimeout(function() { $(“[id*=’_unselected’]”).removeAttr(‘style’); $(“[id*=’_selected’]”).removeAttr(‘style’); }, 100); }); $(“[id*=’_selected’]”).dblclick(function(){ setTimeout(function() { $(“[id*=’_unselected’]”).removeAttr(‘style’); $(“[id*=’_selected’]”).removeAttr(‘style’); }, 100); }); $(“[title=’Add’]”).click(function(){ setTimeout(function() { $(“[id*=’_unselected’]”).removeAttr(‘style’); $(“[id*=’_selected’]”).removeAttr(‘style’); }, 100); }); $(“[title=’Remove’]”).click(function(){ setTimeout(function() { $(“[id*=’_unselected’]”).removeAttr(‘style’); $(“[id*=’_selected’]”).removeAttr(‘style’); }, 100); });});
Getting Dynamic Initialized recordList
public class RecordListUtility { public static String getIntializedRecordList(String objectName, Set fieldNames, String listVariable, Integer limitRows) { String sqlString = ‘Select ‘; for(String field : fieldNames) { sqlString += field + ‘, ‘; } sqlString = sqlString.substring(0, sqlString.length() – 2); sqlString += ‘ from ‘ + objectName + ‘ limit ‘+ limitRows; List objectRecordList = Database.Query(sqlString);Continue reading “Getting Dynamic Initialized recordList”
Creating portal user through trigger
Portal user will be created if unique email is inserted in contact.If user is already created, no new portal user will be created for that contact. trigger CreatePortalUser on Contact (after insert, after update) { List usersToInsert = new List(); List ExistingUsers = [Select contactId from User where contactId in: Trigger.NewMap.keySet()]; Set contactsHavingUsers = newContinue reading “Creating portal user through trigger”
Getting Where condition string for filtering specific object records
Below is the function and wrapper class which can be used to get where condition. This function can be customized as per different requirement. //Returns wherecondition for soql based on SearchFieldWrapper class list which can be used on visual force page for filter functionality.public String getWhereCondition (List searchFieldWrapperList) { String whereCondition = ”; for (WrapperClassContinue reading “Getting Where condition string for filtering specific object records”
Getting customfieldtype based on field display type
We will use customfieldtype later to generate dynamic query from list of fields of specific object. public String getCustomFieldType(Schema.DisplayType fieldType) { String customFieldType; Set stringTypes = new Set(); stringTypes.add(Schema.DisplayType.Reference); stringTypes.add(Schema.DisplayType.ID); stringTypes.add(Schema.DisplayType.String); stringTypes.add(Schema.DisplayType.Email); stringTypes.add(Schema.DisplayType.URL); stringTypes.add(Schema.DisplayType.Picklist); stringTypes.add(Schema.DisplayType.Phone); Set numberTypes = new Set(); numberTypes.add(Schema.DisplayType.Double); numberTypes.add(Schema.DisplayType.Percent); numberTypes.add(Schema.DisplayType.Integer); numberTypes.add(Schema.DisplayType.Currency); if(fieldType == Schema.DisplayType.MultiPicklist) { customFieldType = ‘str’; } else if(stringTypes.contains(fieldType)) {Continue reading “Getting customfieldtype based on field display type”
Getting operator list based on field display type
Below is the function which you can include in any of the class where you want to return operator list based on field type. public List getOperatorList(Schema.DisplayType fieldType) { List operatorList = new List(); operatorList.add(new SelectOption(”, ‘–None–‘)); Set stringTypes = new Set(); stringTypes.add(Schema.DisplayType.Reference); stringTypes.add(Schema.DisplayType.ID); stringTypes.add(Schema.DisplayType.String); stringTypes.add(Schema.DisplayType.Email); stringTypes.add(Schema.DisplayType.URL); stringTypes.add(Schema.DisplayType.Picklist); stringTypes.add(Schema.DisplayType.Phone); Set numberTypes = new Set(); numberTypes.add(Schema.DisplayType.Double);Continue reading “Getting operator list based on field display type”