Skip to main content

Posts

Showing posts with the label code

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

Named Credential Example with Apex Code in Salesforce

Introduction: Named Credentials are a powerful feature in Salesforce that allow you to securely store authentication information for external services and provide a simplified way to make callouts to those services. By leveraging Named Credentials, developers can easily manage and update credentials without modifying the underlying code. In this blog post, we will explore an example of how to use Named Credentials with Apex code in Salesforce. Prerequisites: To follow along with this example, you should have a basic understanding of Salesforce development, Apex programming, and Named Credentials.

LWC Online Tool and Resource for Every Salesforce Developer

Introduction: Salesforce is a powerful platform for building enterprise-level applications and managing customer relationships. With the advent of Lightning Web Components (LWC), developers now have a modern and efficient way to create dynamic user interfaces in Salesforce. To enhance the development experience and help developers harness the full potential of LWC, an online tool and resource hub has emerged, providing valuable assistance and support throughout the development process. In this blog post, we will explore the LWC online tool and resource and discuss how it benefits Salesforce developers. 1. What are Lightning Web Components? Before diving into the online tool and resource, it's essential to understand what Lightning Web Components are. LWC is a programming model and framework for building web components on the Salesforce Lightning Platform. It empowers developers to create reusable, performant, and secure UI components using standard web technologies like HTML, C...

My First Code in Salesforce LWC: Exploring the Basics

Introduction: Welcome to my blog, where I will be sharing my experience of writing my first code in Salesforce Lightning Web Components (LWC). As a Salesforce developer, I was eager to dive into LWC, a modern and efficient way to build Salesforce user interfaces. In this blog post, I will walk you through the process of creating a simple LWC component and explain the code step by step. Setting Up the Development Environment: Before we begin, make sure you have set up your Salesforce Developer Edition org and enabled the Lightning Web Components feature. You will also need a code editor such as Visual Studio Code with the Salesforce Extensions Pack installed. Creating the LWC Component: To get started, navigate to your Salesforce org and follow these steps: Step 1: Create a new Lightning Web Component: In the Salesforce setup, search for " Lightning Web Components " and click on " New ." Provide a name for your component, such as " HelloWorld ," a...

Unlocking the Potential: Performing HTTP Callouts in Salesforce Batch Apex Class

  Introduction : When working with batch Apex in Salesforce, incorporating HTTP callouts can provide powerful integration capabilities. However, there are certain considerations and limitations that need to be addressed. In this guide, we will explore the steps to enable HTTP callouts in a batch Apex class and discuss important factors to keep in mind to ensure successful execution. Let's dive in! Enabling HTTP Callouts with Database.AllowsCallouts Interface: To execute HTTP callouts within a batch Apex class, it is essential to implement the Database.AllowsCallouts interface. Failure to do so will result in an error message stating "callout not allowed." By implementing this interface, you grant permission for callouts to be made during the batch execution. Managing Callout Limits: It's important to be mindful of the callout limit imposed by Salesforce. In a single transaction of a batch class, you can make up to 100 callouts. Exceeding this limit will result in the ...

Exploring LWC Events and Their Functionality in Code

Introduction: Lightning Web Components (LWC) is a powerful framework provided by Salesforce for building modern, performant, and reusable web components on the Salesforce platform. LWC's event system plays a vital role in facilitating communication between components and handling user interactions. In this blog post, we will dive deep into LWC events, understand their working, and explore how they can be utilized effectively in your code.

Efficient LWC Auto Fill: Streamlining Data Entry with Smart Code

 To implement autofill functionality in a Lightning Web Component (LWC), you can use the ' lightning-input ' component and handle the ' change'  event to perform the autofill logic. Here's an example of how you can achieve this: First Example : <template>   <lightning-input label="Search" onchange={handleSearchChange} value={searchTerm} autocomplete="off"></lightning-input> </template> JavaScript file (autofillExample.js): import { LightningElement, track } from 'lwc'; export default class AutofillExample extends LightningElement {   @track searchTerm = '';   handleSearchChange(event) {     this.searchTerm = event.target.value;     // Perform autofill logic here     // Example: Fetch suggestions based on the entered search term     // and update the search input value with the first suggestion     // You can use an API call or a predefined list of suggestions   ...

Scenario-Based Interview Questions with Code for Trigger in Salesforce

Introduction: Salesforce triggers are powerful mechanisms used to automate business processes and perform specific actions when certain events occur within the Salesforce platform. In a scenario-based interview, candidates may be asked to demonstrate their understanding of triggers by solving real-world problems and writing code to implement the desired functionality. In this blog post, we will explore a few scenario-based interview questions related to triggers in Salesforce, along with example code solutions.

Effortless Data Management: jQuery DataTables with Pagination in Apex and Visualforce

Introduction: Managing large amounts of data in Apex and Visualforce can be challenging, especially when it comes to displaying and organizing it effectively. However, with the power of jQuery DataTables, you can easily implement pagination, sorting, and searching functionalities to enhance the data presentation and user experience. In this blog post, we will explore how to integrate jQuery DataTables with pagination into your Apex and Visualforce pages. Let's dive in and discover how to streamline your data management effortlessly.

Popular Posts