Posts

Showing posts from January, 2025

Why Coding Isn’t Scary: Simplifying Flows with Apex in Salesforce

For many Salesforce administrators, the idea of writing code might seem intimidating. However, with a little guidance, it can unlock powerful solutions that simplify complex use cases. Today, let’s explore an example challenge in event registration and how combining declarative tools with a bit of Apex code can make life easier. The Use Case: Event Registration with Speaker Verification Imagine you’re tasked with building a screen flow for event registration. Your flow needs to check if a user (represented by a Contact) is listed as a speaker for an event. In the client's custom data model, events can have multiple layers of speakers: Speakers directly linked to the event. Moderators assigned to tracks within the event. Speakers assigned to sessions, which may have up to three per session. You could handle this entirely with declarative tools like loops, decisions, and subflows, but things get messy fast - especially if the requirements expand to include other ticket types like ...

Navigating Lightning Web Security (LWS) Restrictions with Iframes (CORS)

With the Salesforce Spring ‘25 release , new Lightning Web Security (LWS) restrictions are causing headaches for developers who use iframes in their applications. If you’ve encountered the dreaded error: Access to XMLHttpRequest at 'https://m.stripe.com/6' from origin 'null' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header has a value 'https://m.stripe.network' that is not equal to the supplied origin. POST https: //m.stripe.com/6 net::ERR_FAILED 200 (OK) You’re not alone. This issue isn’t just Stripe-specific -  it can occur with any iframe-based integration under the new LWS rules. Let’s break down what’s happening and how to adapt. What Changed in Spring ‘25? According to the Salesforce release notes : Previously, LWS allowed access to iframe elements if they shared the same origin as the parent page. Now , all iframes with an explicit src attribute are subject to cross-origin restrictions, even if their source ma...