Implementing Salesforce’s Web-to-Lead and Web-to-Case functionality with JavaScript while ensuring CORS compatibility.

Have you encountered CORS problems when embedding Web-to-Lead or Web-to-Case forms on your website? Cross-Origin Resource Sharing Cross-Origin Resource Sharing (CORS) involves an HTTP header mechanism enabling a server to specify origins (domains, schemes, or ports) other than its own from which a browser can load resources. CORS errors arise when a server doesn’t provide …

Implementing Salesforce’s Web-to-Lead and Web-to-Case functionality with JavaScript while ensuring CORS compatibility. Read More »

Retrieve the first element from a SET using Apex

Greetings, Trailblazers, You’re likely aware of the distinction between LIST and SET in Apex. You might be curious about accessing the first (or any) element of a SET without iterating. Through iteration, this can be easily accomplished. Without the need for iteration – Here’s a straightforward technique, #Salesforce #Apex

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 »