Distribute JavaScript Code within a Lightning Web Component for Accessing URL Parameters

In this article, we’ll craft a Lightning Web Component intended for sharing as a JavaScript library among other LWCs. We’ll create an LWC Component serving as a utility method to retrieve query parameters, demonstrated below: As seen in the provided code, creating a JavaScript file and a meta file is all that’s required for the …

Distribute JavaScript Code within a Lightning Web Component for Accessing URL Parameters Read More »

Leveraging Custom Labels in Lightning Web Components – LWC

Here’s a code snippet illustrating the utilization of custom labels in Lightning Web Components. Suppose we have custom labels named welcomeText and exitText. In the LWC’s JavaScript file, we need to adhere to the following syntax: Take note of how we imported the label and utilized ‘c.’ if there is no namespace.

Handling Events in Lightning Web Components – Publish-Subscribe

It is very common to come across use case of communicating between Lightning Web Components. If you are not interested on code explanation and directly want to jump on live demo , check this playground. Establish Communication Among Enclosed Lightning Web Components This scenario is among the simplest and most common, where the parent LWC needs to …

Handling Events in Lightning Web Components – Publish-Subscribe Read More »

Distribute JavaScript Code within a Lightning Web Component for Accessing URL Parameters

In this article, we’ll craft a Lightning Web Component intended for sharing as a JavaScript library among other LWCs. We’ll create an LWC Component serving as a utility method for extracting query parameters, demonstrated below: As observed in the code above, all that’s required is the creation of a JavaScript file and a metadata file …

Distribute JavaScript Code within a Lightning Web Component for Accessing URL Parameters Read More »

Utilizing SalesforceDX (SFDX) in conjunction with non-Scratch Orgs.

We’ve reviewed several blog entries regarding SFDX and its functionalities before. In this post, I’ll outline the process of utilizing SFDX with Developer, Sandbox, or Production Orgs. Essentially, we’ll cover the utilization of SFDX with non-Scratch Orgs. Our tool of choice will be the official Salesforce IDE for SFDX, namely VSCode. Assuming you’ve already installed …

Utilizing SalesforceDX (SFDX) in conjunction with non-Scratch Orgs. Read More »

Automate for Success: Elevate Your Salesforce Development with Task.json

How often do you find yourself Googling your preferred Salesforce DX Commands? Have you encountered situations in previous projects where you couldn’t easily recall or access the commands needed for deployment automation? For quite some time, I’ve relied on Task.json within VSCode to: Consistently, I’ve implemented a standardized Task.json across all my projects, regularly updating …

Automate for Success: Elevate Your Salesforce Development with Task.json Read More »

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 »