Difficulty in unit testing, simulating callouts, and execution under a specific user context

Background I’m building multiple business applications within a community, and these apps heavily depend on making callouts to an ERP system for data verification, retrieval, or pushing data. To properly test the code in these applications, it’s crucial to run unit tests as community users. I’m utilizing the mock response interface to simulate API responses …

Difficulty in unit testing, simulating callouts, and execution under a specific user context Read More »

Examining asynchronous @future callouts

I’ve extensively searched through documentation, Trailhead, and various resources, but I’m stuck. In my test class, I’m encountering an issue with the HttpCalloutMock method. The problem arises because the class I’m calling returns void, causing an “Illegal assignment from void to System.HttpResponse” error when trying to return the response. Unfortunately, I can’t modify the class …

Examining asynchronous @future callouts Read More »

Lightning Web Components Introduction | Comprehensive Guide

Lightning Web Components (LWC) represent a novel framework tailored for constructing UI components within Salesforce applications. These components harness standard web languages such as HTML, CSS, and JavaScript, enabling the development of reusable elements. Advantages of LWC Organizing a Basic LWC An LWC encompasses a directory containing these essential files: Here’s an example of a …

Lightning Web Components Introduction | Comprehensive Guide Read More »

Creating Salesforce Records via Email Service Attachments

Email Handler Service The email service entails an automated process that meets business needs by employing Apex classes to handle the content, attachments, and headers of incoming emails. A practical scenario benefiting from an email service is outlined below: Suppose there’s a .CSV file containing Account records to be inserted into Salesforce. Using the email …

Creating Salesforce Records via Email Service Attachments Read More »

Custom Roll-up Summary on Account Object | Salesforce Developer Guide

In this article, I’ll demonstrate how to showcase a custom roll-up summary on the Account object. Before delving into the code, start by creating a custom field of number type on the Account object. Associated_Contact_Count__c Our objective is to display the count of all contacts associated with a specific account within the field named “Associated_Contact_Count__c”. …

Custom Roll-up Summary on Account Object | Salesforce Developer Guide Read More »

Retrieving Failed Records from Database.Insert/Upsert | Salesforce Developer Guide

Salesforce offers diverse options for DML operations. Imagine a scenario where the requirement involves saving file data into the database, with Salesforce supporting only CSV file formats, necessitating adherence to the CSV format as the initial step. Subsequently, after file retrieval, distinct methods apply for Visualforce and Aura Lightning Components. In Visualforce, you employ <apex:input> …

Retrieving Failed Records from Database.Insert/Upsert | Salesforce Developer Guide Read More »

Enabling Communication Between Two Salesforce Lightning Components Using Attributes

Facilitating communication between two Salesforce Lightning Components involves transferring data between a child and parent component or vice versa. A direct interaction between a component and its parent or another component isn’t possible via standard JavaScript. Communication channels must be explicitly defined by the programmer. Communication between Salesforce Lightning Components can occur through two methods: …

Enabling Communication Between Two Salesforce Lightning Components Using Attributes Read More »

Apex’s RemoteAction Annotation | Salesforce Apex Developer Guide

Annotations: An Apex annotation, similar to a Java annotation, alters the usage of a method or class. Annotations commence with a @ symbol, succeeded by the relevant keyword. To include an annotation in a method, indicate the annotation just preceding the method or class declaration. For instance: This blog will cover the @RemoteAction Annotation. Annotation: …

Apex’s RemoteAction Annotation | Salesforce Apex Developer Guide Read More »