Skip to main content

Posts

Determine the execution context in apex

      The Quiddity Enum stands out as a highly valuable but often overlooked feature, offering one of the most effective means to grasp the context of Apex execution. Leveraging Quiddity allows us to discern whether an Apex method is invoked from Lightning Web Components (LWC), Aura, or an Anonymous context. Explore the comprehensive documentation linked below to discover the full range of contexts supported by Quiddity. Below is the Example of Quiddity. public List<Account> getAccountsWithQuiddityGuard () {       List<Account> accounts = new List<Account>();               public static List<Quiddity> allowedQuiddities = new List<Quiddity>{              Quiddity.QUEUEABLE,              Quiddity.BATCH_APEX,      ...

Generate Payment UPI QR Code in Salesforce

  Did u know?  Now we can generate the Payment QR code in salesforce using google chartAPI.     QR codes, also referred to as hardlinks or physical world hyperlinks, have gained widespread popularity as a form of two-dimensional barcode. They have the capacity to store a versatile range of up to 4,296 alphanumeric characters, allowing them to encode various types of information such as URLs, contact details, phone numbers, or even literary works like poems. QR codes can be decoded by optical devices equipped with the necessary software, which includes dedicated QR code readers as well as mobile phones.     Syntax    Root URL:  https://chart.googleapis.com/chart? QR code requests support the following URL query parameters after the ? in the root URL: Parameter Required or Optional Description cht=qr Required Specifies a QR code. chs=<width>x<h...

Custom Error Component in Salesforce Flows

  Flow has established itself as the leading declarative automation solution for Salesforce, making it a focal point for all Salesforce professionals today. Whether you require a visual tool to streamline your business processes or to effortlessly automate tasks within your Salesforce environment, the extensive range of features offered by Salesforce Flow has proven invaluable. With the introduction of Salesforce's Winter '24 release, a set of new components is set to enhance this powerful tool. Among them, Custom Error stands out as a much-anticipated addition, poised to empower Salesforce Admins to elevate their data integrity processes by leveraging the built-in capabilities of record-triggered flows. That's correct! While it might seem like the new component could replace validation rules, that's not the case at all. Validation rules remain highly valuable, provided your specific use case falls within their capabilities. Up until now, when there was a need to iterat...

LWC Enhancements for Developers

  The Spring '23 release brings an abundance of exciting new features. Among these are enhancements to Lightning Web Components (LWCs) that aim to boost productivity, enhance security, and provide other useful utilities. These improvements facilitate debugging of LWC wired properties, enable synchronized component data without the need for page refreshes, introduce enhanced security layers for both LWC and Aura components, and offer additional tools for improved component testing. In this blog post, we will delve into the details of these updates. View debug information for your wired properties Inspecting Wired Properties with Debug Information Starting from Spring '23, debugging wired properties and methods becomes more straightforward through custom formatters in the Chrome debugger. Previously, developers had to use a wired function to retrieve deconstructed data and error properties for inspection. This new feature eliminates the need for rewriting wired properties and sea...

Shallow Clone Vs Deep Clone in LWC !!

  Are you acquainted with the concept of shallow and deep cloning within Lightning Web Components (LWC)?  Shallow cloning involves crafting a fresh object that retains the same reference as the original, whereas deep cloning entails c rafting a novel object with an entirely new reference . 👉 Why does this matter? Well, imagine having an object with nested attributes, and you wish to modify one of these attributes without impacting the original object. Opting for shallow cloning means that any adjustments made to the nested attribute will likewise manifest in the original object. However, by embracing deep cloning, you can alter the nested attribute without influencing the source object. 💻 When working with LWC, you can utilize the spread operator to execute shallow cloning, and resort to the JSON.parse/JSON.stringify technique to achieve deep cloning. 👨‍💻 Grasping the distinction between shallow and deep cloning is crucial for ensuring accurate object updates, while side...

Sharing records by Apex in Salesforce

  Greetings, everyone! In today's session, we'll delve into the topic of sharing records within an Apex class. As we're aware, there exist various methods through which we can accomplish the sharing of records. We engage in record sharing primarily when the object's Organization Wide Default (OWD) settings are set to private. Sharing settings come into play when certain predefined criteria are met, allowing us to extend access to records to designated groups or roles. In cases where intricate logic is involved, manual sharing is employed. While this approach proves beneficial for specific records, instances where a multitude of records require automated handling, Apex sharing becomes the preferred solution. Salesforce offers a 'Share' object for each type of object, with distinct naming conventions: For standard objects, it's 'StandardobjectName+Share', such as 'AccountShare' for the 'Account' object. Custom objects follow the pattern...