Use force:refreshView (or getRecordNotifyChange) in a Lightning web component.

We have a strong appreciation for the Lightning UI and the aura feature (e.force:refreshview), which updates the data on the current Lightning page, record, or component. However, we found that this feature was missing in LWC, and many resorted to using a combination of Aura and LWC to achieve this functionality. As of Winter ’21, …

Use force:refreshView (or getRecordNotifyChange) in a Lightning web component. Read More »

Best Practices and Considerations for Lightning Web Components (LWC).

Hello again! This blog post takes a unique approach as it will continuously receive updates with the latest findings. I will be sharing best practices and considerations related to LWC, drawing from both Salesforce guidelines and personal experiences. Let’s begin with the topic of FOR LOOPS. 1- FOR LOOPS JavaScript ES6 introduces a distinct type …

Best Practices and Considerations for Lightning Web Components (LWC). Read More »

Retrieve the values of Object and Field Labels using API Names.

This scenario frequently arises when you possess the API Name but require the current labels for your object or field, whether it’s custom or standard. While you usually have this information in advance, there are instances where it becomes necessary when dynamically composing your Apex. Presented here is a straightforward method that takes API Names …

Retrieve the values of Object and Field Labels using API Names. Read More »

Apex test cases encounter failures when executed concurrently.

At present, when running Apex test cases through either Apex Test Execution or ApexTestQueueItem records, two cases are executed simultaneously. Typically, this is not problematic; however, issues may arise if the test cases lack complete isolation (e.g., they operate on the same records) and data isolation is disabled. Failures might occur that wouldn’t manifest if …

Apex test cases encounter failures when executed concurrently. Read More »

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 »