Static Resource Test Class Data

By utilizing the Test.loadData method, you can effortlessly input data into your test methods, eliminating the need for extensive code. Just follow these steps: For instance, if you’re dealing with Account records and the static resource is named myResource, make the following call: The Test.loadData method provides a list of sObjects corresponding to each inserted …

Static Resource Test Class Data Read More »

Toggle Class Dynamically in Lightning Web Components (LWC)

In this straightforward situation, the objective is to toggle the visibility of a div, but the conventional <template if:true> tag is not applicable. Consider a scenario where a loop is in use. We will explore two alternative methods for achieving dynamic show/hide functionality in LWC without relying on the <template if:true> approach. Simplified Method for …

Toggle Class Dynamically in Lightning Web Components (LWC) Read More »

Create callable actions that function across various objects.

Following the Spring 20 update, it is now possible to craft reusable Apex actions employing the generic sObject and List<sObject> data types. Instead of creating a distinct action for each object, you can now construct a singular action capable of functioning across multiple objects. Developers have the flexibility to design a filter or sort action …

Create callable actions that function across various objects. Read More »

Concealing the Standard Lightning Page Header on a Custom App Page

From : to This: There are two methods to accomplish this. Approach 1 Starting from W19, it’s now possible to include Lightning components as tabs. This approach eliminates the need for a custom header. I strongly recommend considering this option unless you intend to incorporate global actions on your new tab page. In your Lightning …

Concealing the Standard Lightning Page Header on a Custom App Page Read More »

Error: Guest users are not permitted to perform this operation: Caused by Flow action – “Post to Chatter”

Introduction You may get this error when a flow has action – Post to Chatter and record is being created using Guest user. This is as expected as Guest User can not create Chatter Feed in the system. Workaround No, you cant access Chatter with Guest User Content. No matter what you do, if you …

Error: Guest users are not permitted to perform this operation: Caused by Flow action – “Post to Chatter” Read More »

System.LimitException: Too many query rows: 50001

PROBLEM This error occurs when you are trying to return more than 50000 records from the SOQL query. In order to resolve the issue either you will have to limit the number of records returned from the SOQL or you will have to process them in the chunks. Example: WORKAROUD

The error encountered in the Lightning component when using setTimeout: “Bind must be invoked on a function.

In our complex application’s component controller, the following code was present: The functionality is operational; however, it generates an error message that is shown at the bottom of the page. A function must have ‘bind’ invoked on it. Solution Resolution 2 . As per setTimeout documentation, use any one of the following if calling function doesn’t …

The error encountered in the Lightning component when using setTimeout: “Bind must be invoked on a function. Read More »

Implementing Custom Validation within a Lightning Web Component

The Lightning component is relatively new, and I faced challenges when trying to implement custom validation for fields, particularly for the ‘lightning-input’ component. There is limited information available on the internet at the moment, and I believe others may be encountering similar difficulties. Fortunately, I was able to find a solution that worked for me, …

Implementing Custom Validation within a Lightning Web Component Read More »