Skip to main content

Posts

Showing posts with the label apex class

Latest Post

Record Types & Page Layout Strategy

  Record Types & Page Layout Strategy 💬 In plain words:   Record Types let one object act like different forms for different teams. Different picklist values, page layouts, and processes — same Account object. Use them for truly different business processes. Not for cosmetic layout changes. 📌 Example:   One Account object, two businesses: 'Retail Customer' record type shows B2C picklist values and layout. 'Enterprise Client' shows contract fields and a different sales process. Same table, two costumes. 🧠 One object, many costumes:   A Record Type is a costume on the same object — different picklists and layouts, same table underneath. Concept Record Types split one object into business variants. •   Each type can carry its own subset of picklist values, its own business process — Lead, Case and Opportunity stages — and its own page layout per profile. •   Lightning has changed the calculus. Dynamic Forms and conditional comp...

A Comprehensive Guide to the Apex Debugger in Salesforce

Introduction: As a Salesforce developer, efficient debugging is essential to identify and resolve issues in your Apex code. Salesforce provides a powerful tool called the Apex Debugger, which allows you to step through your code, inspect variables, and analyze the flow of execution. In this blog post, we'll explore the Apex Debugger and learn how to leverage its features to streamline the debugging process in Salesforce. Table of Contents: 1. Introduction 2. What is the Apex Debugger? 3. Enabling the Apex Debugger 4. Setting Breakpoints 5. Stepping Through Code 6. Inspecting Variables 7. Using Debug Logs 8. Best Practices for Effective Debugging 9. Conclusion What is the Apex Debugger? The Apex Debugger is a tool provided by Salesforce that allows developers to interactively debug Apex code. It provides a controlled environment to step through code execution, pause at breakpoints, inspect variables, and gain insights into the flow of the program. The Apex Debugger is...

Full Dynamic Working Code for Calling Apex Methods Synchronously in LWC

Introduction: In Lightning Web Components (LWC), one of the powerful features is the ability to invoke server-side Apex methods asynchronously using the wire service. However, there are situations where you may need to call Apex methods synchronously to ensure proper execution order or to handle certain scenarios. In this blog post, we will explore a full dynamic working code example that demonstrates how to call Apex methods synchronously in LWC. Let's dive in!

jQuery search bar for visualforce page

Here is sample code for client side  search with the help of jQuery in visuaforce page. By using below code you can make FAQ type functionality or perform a search using specific phrase or word. In below sample code , We are using account details like name, phone.  Sample Code <apex:page controller="PageSearch" showHeader="false" doctype="html-5.0"  sidebar="false" applyHtmlTag="true" id="page" lightningStylesheets="true">     <html xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" lang="en">         <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>         <head>             <meta charset="utf-8" />             <meta http-equiv="x-ua-compatible" content="ie=edge" />             <title> Salesforce Lightning Design System ...

Get salesforce SOQL result in JSON format in apex

Sometime we need SOQL query result in JSON format and  JSON.serialize help us to get result in JSON format. Below is syntax. string query='SELECT id, name from account'; string Outputget= JSON.serialize(database.query(query));  system.debug(Outputget); The above syntax gives us following result:- [    {       "attributes":{          "type":"Account",          "url":"/services/data/v48.0/sobjects/Account/ your account ID "       },       "Id":" your account ID ",       "Name":"Test Account Name"    } ]

Assign value to a apex variable in Visualforce page using javascript or jquery

Some time we need to send a variable value to apex class variable in visualforce page. There are many ways to do this. Here is very simple way to do this. <apex:actionFunction id="ID" name = "javascriptFunction" action = "{!valuesUsingJS }" > <apex:param value = "" name = "parameterName1" /> <apex:param value = "" name = "parameterName2" /> </apex:actionFunction>

How to Use standard set controller with wrapper class?

Sometimes we need to develop pagination with wrapper class. here is way to do with standard set controller. Pagination with standard set controller and wrapper class.                                                                                                                                                                                                                                            ...

How to Save Quote PDF, Send PDF, Preview PDF in salesforce with custom functionality

Want to develop custom pdf viewer, save pdf in quote pdf related List and Send quote to customer on button click when quote is custom in salesforce . These functionality are standard from salesforce. but you can develop these functionality custom in salesforce. Here is the solution:- Custom button to save Quote PDF and send PDF  Step 1:-  First Create Two custom button. which will used for PDF preview and Save quote pdf in quotes pdf related list.                               1. PDF preview Button                              2. Save & Send Quote Button Replace "Your VF page here" to Your quote PDF cuatom page. Step 2:-  PDF preview button   pdf preview button will display the pdf's preview in standard format of salesforce. So you need to set the  following configuration (In picture). After that you have ...