Skip to main content

Posts

Showing posts with the label CLI

Latest Post

Custom Metadata Types vs Custom Settings vs Custom Labels

  Custom Metadata Types vs Custom Settings vs Custom Labels 💬 In plain words:  Three lookalikes: Custom Metadata = configuration that DEPLOYS with your code (best for app settings). Custom Settings = org/user-specific values, changeable at runtime (hierarchy type is great for bypass switches). Custom Labels = translatable text for the UI. 📌 Example:  API endpoint URLs per environment → Custom Metadata (deploys with code, sandbox vs prod values). A 'Bypass_Automation__c' checkbox an admin flips during data load → hierarchy Custom Setting. The word 'Submit' translated to Hindi → Custom Label. 🎬 Real-Life Example: The Fee Table Trapped Inside Code  Skyline charges a different delivery fee per city. Apex needs those rates on every booking. The Old/Bad Way:  if (city == 'Delhi') fee = 50. Else if (city == 'Mumbai') fee = 65. … Every rate change is a code change, a test run, and a deployment. Why this is bad:  Business data is trappe...

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 ) ||   ...

Create object, fields CSV file in salesforce using apex

 Below is sample code to to get all object and their fields in CSV using apex in salesforce. In this sample code we are getting objects using namespace and making CSV file. pubLIC class ObjectFieldsinReport{     public void makecsvwithobjectandfield(){         map<string, SObjectType> objs = schema.getGlobalDescribe();         string header = 'Object Name, Field, Label \n';         string finalstr = header ;         for(string key: objs.keySet()){             //if condtion to handle namespace objects //remove this  key.startsWithIgnoreCase('Your objects namespace') if you want to use all objects             if(key.startsWithIgnoreCase('Your objects namespace') && key.endsWithIgnoreCase('__c')){                 map<string, string> fieldList = new map<string, string>...

Streamlining Business Processes with Salesforce REST Integration

Introduction: Salesforce is a robust customer relationship management (CRM) platform that offers powerful capabilities for managing customer data, automating sales processes, and driving business growth. Salesforce REST integration provides a seamless way to connect and interact with external systems, enabling businesses to extend the functionality of Salesforce and streamline their business processes. In this blog post, we will explore the features, benefits, and potential of Salesforce REST integration in driving productivity and enhancing data integration. 1. What is Salesforce REST Integration? Salesforce REST integration allows applications and systems to communicate with Salesforce using the Representational State Transfer (REST) architecture. REST is an architectural style that uses standard HTTP methods (GET, POST, PUT, DELETE) to access and manipulate resources, making it a widely adopted and versatile integration approach. 2. Key Benefits of Salesforce REST Integration:...

Simplifying Package.xml Retrieval in Salesforce: Alternatives to Workbench

Introduction: When working with Salesforce metadata deployments, retrieving the package.xml file is a crucial step. Traditionally, developers have relied on tools like Workbench to generate the package.xml file. However, there are alternative methods available that can simplify the process and offer more flexibility. In this blog post, we will explore different approaches to obtain the package.xml file without relying on Workbench. 1. Salesforce CLI: Salesforce CLI (Command Line Interface) provides a powerful command-line toolset for Salesforce development and deployment. Using Salesforce CLI, you can retrieve the package.xml file by executing the following command in your command-line interface: sfdx force:source:retrieve -x path/to/package.xml This command retrieves the metadata specified in the package.xml file and downloads it to your local machine. Salesforce CLI offers enhanced flexibility and automation capabilities compared to Workbench, making it a preferred choice for...

Creating LWC Components with Icons Inside Input and Output Fields

Introduction: In this blog post, we will explore how to develop Lightning Web Components (LWC) without using standard Salesforce screens. Specifically, we will focus on incorporating icons inside input and output fields. Icons can provide visual cues to users and enhance the overall user experience. By the end of this tutorial, you'll be able to create LWC components that seamlessly integrate icons within input and output fields.

Streamline Salesforce Development with Salesforce CLI

Introduction: Salesforce CLI (Command Line Interface) is a powerful tool that allows developers and administrators to manage and deploy applications on the Salesforce platform efficiently. With its wide range of features and capabilities, Salesforce CLI simplifies development workflows, enhances productivity, and enables seamless collaboration among teams. In this blog post, we will explore the benefits and functionalities of Salesforce CLI and how it can revolutionize your Salesforce development experience.

What is Salesforce DX (SFDX)? Simplifying Modern Development on the Salesforce Platform

Introduction: In the realm of Salesforce development, the introduction of Salesforce DX (SFDX) has revolutionized the way developers build and manage applications on the Salesforce platform. SFDX offers a streamlined and modern approach to development, providing a robust set of tools and practices for teams to collaborate, version control, and deploy their applications efficiently. In this blog post, we will delve into the fundamentals of Salesforce DX and explore its key features and benefits.

Salesforce knowledge park is here...

Here is a list of Salesforce, Trailhead, VS Code, Lightning ,LWC learning resources at one palace . without adding too much theory lets go...  1. Lightning Design system:- This includes cross-browser compatible CSS, Icon, Font, Component and design guidelines. Just copy the base design and use on your pages. Lightning Design System 2. Lightning Web Component:-   This is library where you can find LWC related all the materials including Locker console, Playground. Lightning Web Component  3. Salesforce LWC Playground:-  Here you can play with HTML, JavaScript and CSS. This tool also gives download and upload functionality.

Popular Posts

Salesforce LWC Code for Multi-Select Lookup

Introduction: In Salesforce Lightning Web Components (LWC), implementing a multi-select lookup field can enhance the user experience and provide greater flexibility for selecting multiple related records. In this blog post, we will walk through the process of creating a multi-select lookup field using LWC. We will cover the required code snippets and provide step-by-step instructions to help you implement this functionality in your Salesforce org.