Skip to main content

Posts

Showing posts with the label Salesforce CLI

Latest Post

How to Set Up Two-Factor Time-Based One-Time Password (TOTP) Authentication on iPhone Without Third-Party Apps

Unlocking an additional layer of safety to your iPhone is less difficult than you might suppose. With Two-Factor Time-Based One-Time Password (TOTP) authentication, you may bolster your device's protection and other website safety without relying on 1/3-party apps. Here's how you could set it up:

How to Check for Duplicates in Salesforce using "From Date" and "To Date" with Apex Trigger

Introduction : In Salesforce, ensuring data integrity is crucial for maintaining accurate records. One common scenario is checking for duplicates based on specific criteria. In this blog post, we'll explore how to use an Apex Trigger to identify and prevent duplicates based on the "from date" and "to date" fields. Prerequisites: Before proceeding, make sure you have a basic understanding of Salesforce development and Apex Triggers. Scenario: Let's consider a custom object called "Event" that has two date fields: "From_Date__c" and "To_Date__c". We want to prevent users from creating duplicate events where the "from date" and "to date" overlap with existing records. Apex Trigger Code: To achieve this, we'll write an Apex Trigger on the "Event" object that runs before the records are inserted or updated. Here's the code: trigger PreventDuplicateEvents on Event (before insert, befor...

Pagination in Visualforce page with help of wrapper class and Stadardsetcontroller

 Want to develop pagination with help of standard set controller and wrapper class in salesforce. here is code:- Pagination in Visualforce page with wrapper class Step 1:-  Create a class with help of below code. public class ClassWithStandardSetController {     Public Integer noOfRecords{get; set;}     Public Integer size{get;set;}     List<SelectedWrapper> categories {get;set;}          public ApexPages.StandardSetController setCon {         get{             if(setCon == null){                 size = 5;                 setCon = new ApexPages.StandardSetController(Database.getQueryLocator([SELECT id,LineNumber,PriceBookEntry.Product2Id, PriceBookEntry.Product2.Name,Product2Id,Quantity,unitprice,QuoteId FROM quoteLineItem]));                 setCon.s...

Trigger to check duplicates in salesforce using "from date" and "to date"

  Here is the Sample code to prevent update and insert records between from date and end date in salesforce. This trigger have two events:- before insert  and  before update trigger Duplicatecheck on <Obejct> (before insert,before update) {     set<object > ListOfrecords= new set<object >([SELECT id,Valid_Form__c,Valid_To__c FROM <object>]);     for(<object>  obj1 : ListOfrecords) {         for(<object> obj2: Trigger.new) {             if(obj2.VS_State__c== obj1.VS_State__c && obj2.vs_Tax_Type__c == obj1 .vs_Tax_Type__c){                 if((obj2.Valid_To__c >= obj1.Valid_Form__c&& obj2.Valid_To__c <= obj1 .Valid_To__c ) ||                    (obj2.Valid_Form__c>= obj1.Valid_Form__c&& obj2.Valid_To__c <= obj1 .Valid_To__c ) ||   ...

How to Start Development in LWC (Lightning Web Components) in Salesforce

Introduction: In the Salesforce ecosystem, Lightning Web Components (LWC) have gained significant popularity as a modern and efficient way to build user interfaces and functionality. LWC provides a powerful framework for developing lightning-fast, responsive, and reusable components within the Salesforce platform. This blog post will guide you through the essential steps to start your development journey with LWC in Salesforce. Step 1: Understand the Basics: Before diving into LWC development, it's crucial to have a solid understanding of the Salesforce platform, including its architecture and concepts like objects, records, fields, and relationships. Familiarize yourself with the basics of HTML, CSS, and JavaScript, as LWC utilizes these technologies. Step 2: Set Up Your Salesforce Developer Environment: To start developing with LWC, you'll need a Salesforce developer environment. Sign up for a Salesforce Developer Edition account, which provides you with a free, fully ...

Building Dynamic Question-Answer Functionality with Visualforce Code

Introduction: In this blog post, we will explore how to implement dynamic question-answer functionality using Visualforce code. Visualforce is a powerful framework provided by Salesforce that allows developers to build custom user interfaces and extend the functionality of their Salesforce applications. By leveraging Visualforce, we can create a dynamic and interactive question-answer feature that enhances the user experience and improves data collection. Let's dive into the implementation details! 1. Setting up the Visualforce Page: First, create a Visualforce page by navigating to Setup in your Salesforce org and selecting "Develop" > "Pages." Click on "New" to create a new Visualforce page. Give it a name and specify the standard controller or custom controller for the object you will be working with.    Start by creating a Visualforce page where you will display the questions and capture user input.    <apex:page controller="Questi...