<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Amrit Suman on Medium]]></title>
        <description><![CDATA[Stories by Amrit Suman on Medium]]></description>
        <link>https://medium.com/@amrit-suman?source=rss-99747e2e36bf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PZ-f-_ig6DGYzP0qdXYrFA.png</url>
            <title>Stories by Amrit Suman on Medium</title>
            <link>https://medium.com/@amrit-suman?source=rss-99747e2e36bf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 09:50:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@amrit-suman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Salesforce → AWS Event-Driven Integration with EventBridge and SQS]]></title>
            <link>https://medium.com/@amrit-suman/building-a-salesforce-aws-event-driven-integration-with-eventbridge-and-sqs-85992dcb4f6b?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/85992dcb4f6b</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 14:53:55 GMT</pubDate>
            <atom:updated>2026-08-16T09:52:15.316Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>My hands-on journey learning how Salesforce can participate in an AWS event-driven architecture.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IpD1ofzyucfmXYcD" /><figcaption>Photo by <a href="https://unsplash.com/@cgower?utm_source=medium&amp;utm_medium=referral">Christopher Gower</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h4><strong>As Salesforce developers, it’s easy to spend most of our time inside the Salesforce ecosystem. But modern enterprise systems rarely live inside one platform.</strong></h4><p>I wanted to understand what happens outside Salesforce — how events move between platforms, how AWS routes those events, how messages are buffered, and how we can troubleshoot the integration when something doesn’t work.</p><p>So I built a small end-to-end integration:</p><p><strong>Salesforce → Platform Event → Event Bus → Event Relay → Amazon EventBridge → EventBridge Rule → Amazon SQS</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8uDTbTjVR7Qs7JmLazRcew.png" /></figure><p>The scenario is simple:</p><p>When an order is submitted in Salesforce, publish an event and asynchronously deliver it to AWS for downstream processing.</p><p>This article covers the major implementation steps and, more importantly, some of the lessons I learned along the way.</p><h3><strong>⚡ 1. Create a Salesforce Platform Event</strong></h3><p>I started by creating a custom Platform Event: Order_Submitted__e. The event contains business information such as:</p><p>OrderId__c, CustomerId__c, Amount__c, CurrencyCode__c, EventVersion__c, CorrelationId__c</p><p>For the initial test, I published the Platform Event using Apex:</p><pre>Order_Submitted__e eventMessage = new Order_Submitted__e(<br> OrderId__c = &#39;ORD-AWS-SQS-001&#39;,<br> CustomerId__c = &#39;CUST-AWS-SQS-001&#39;,<br> Amount__c = 2750.00,<br> CurrencyCode__c = &#39;USD&#39;,<br> EventVersion__c = &#39;1.0&#39;,<br> CorrelationId__c = &#39;LAB-AWS-SQS-001&#39;<br>);<br>Database.SaveResult result = EventBus.publish(eventMessage);<br>System.debug(&#39;Event published: &#39; + result.isSuccess());</pre><p><strong>💡 The important concept here is that Salesforce is publishing an event, rather than making a synchronous call to AWS.</strong></p><h3><strong>🔐 2. Create the Salesforce Named Credential</strong></h3><p>Before creating the Event Relay, I configured a Salesforce Named Credential for the AWS account.</p><p>For Event Relay, Salesforce uses the Named Credential to store the AWS account and region information needed for the relay configuration. Region Name should be in upper case.</p><p>Conceptually: <br><strong>Salesforce → Named Credential → Event Relay → AWS EventBridge</strong></p><p>This is an important enterprise integration practice. Connection and authentication-related configuration should be managed separately from application logic.</p><p>For a public article, environment-specific AWS account information, credentials, tokens, and other sensitive configuration should never be exposed.</p><h3><strong>📡 3. Create the Salesforce Event Channel</strong></h3><p>Next, I configured the Salesforce Event Channel and added the Platform Event as a channel member.</p><p>Conceptually:<br><strong>Order_Submitted__e → Salesforce Event Channel → Event Relay</strong></p><p>The channel determines which Salesforce events are available to be relayed.</p><h3><strong>🔄 4. Create the Salesforce Event Relay</strong></h3><p>With the prerequisites ready, I created the Event Relay in Salesforce Setup. The Event Relay ties together the Named Credential and Event Channel:</p><p><strong>Named Credential + Event Channel → Event Relay</strong></p><p>Salesforce then creates a corresponding Partner Event Source in Amazon EventBridge.</p><p>At this point, the architecture starts to look like:</p><p><strong>Salesforce → Platform Event → Event Bus → Event Relay → Amazon EventBridge</strong></p><h3><strong>☁️ 5. Activate the Partner Event Source in AWS</strong></h3><p>On the AWS side, I went to Amazon EventBridge and found the Salesforce Partner Event Source created by Event Relay. I associated the partner event source with an EventBridge event bus.</p><p>The resulting flow became:<br><strong>Salesforce → Event Relay → Partner Event Source → EventBridge Event Bus</strong></p><p>One useful observation from the lab was that the partner-source setup handled the event-bus association rather than requiring me to treat this as an ordinary standalone EventBridge bus.</p><h3><strong>▶️ 6. Start the Event Relay</strong></h3><p>Once the AWS partner event source was active, I started the Event Relay in Salesforce.</p><p>The pipeline was now ready:<br><strong>Salesforce Platform Event → Event Bus → Event Relay → Amazon EventBridge</strong></p><p>The Event Relay status and Last Relayed information also provided a useful Salesforce-side troubleshooting checkpoint.</p><h3><strong>📨 7. Create an SQS Queue</strong></h3><p>Next, I created a Standard Amazon SQS queue:<br><strong><em>salesforce-order-processing</em></strong></p><p>The purpose of the queue is to provide a durable asynchronous buffer between the event producer and the eventual consumer.</p><p>Instead of:<br><strong>Salesforce → AWS Consumer</strong></p><p>we now have:<br><strong>Salesforce → EventBridge → SQS → Consumer</strong></p><p>The consumer can process messages independently from the Salesforce transaction.</p><h3><strong>🎯 8. Create the EventBridge Rule</strong></h3><p>The next major AWS step was creating a rule on the Salesforce EventBridge bus. The rule listens for:</p><pre><br>The event pattern used was:<br>{<br> &quot;source&quot;: [<br> {<br> &quot;prefix&quot;: &quot;aws.partner/salesforce.com&quot;<br> }<br> ],<br> &quot;detail-type&quot;: [<br> &quot;Order_Submitted__e&quot;<br> ]<br>}</pre><p>The important fields in an EventBridge event are source, detail-type, and detail. Instead of saying “send every Salesforce event to SQS,” the rule says:</p><p>“Send Order_Submitted__e events from the Salesforce partner source to this target.”</p><p>This becomes increasingly useful when an enterprise integration supports many events.</p><h3><strong>🔗 9. Connect SQS as the EventBridge Target</strong></h3><p>I configured the SQS queue as the target of the EventBridge rule.<br>The flow became:<br><strong>Salesforce → Event Relay → EventBridge → Rule → SQS</strong></p><p>EventBridge is now responsible for routing the matching event to the queue. This also introduces an important AWS concept: IAM permissions. EventBridge needs permission to send messages to the SQS queue.</p><h3><strong>🧪 10. The First Test Didn’t Work</strong></h3><p>This was one of the most valuable parts of the exercise. I published an event from Salesforce. The Event Relay showed activity, but I didn’t see the message in SQS. Instead of changing multiple things at once, I broke the integration into boundaries:</p><p><strong>Salesforce → Did it publish?<br>Event Relay → Did it relay?<br>EventBridge → Did it receive?<br>Rule → Did it match?<br>SQS → Did it receive?</strong></p><p>This is a simple but powerful way to troubleshoot distributed systems.</p><h3><strong>🔎 11. Use CloudWatch to Inspect the Event</strong></h3><p>I created a temporary EventBridge rule with CloudWatch Logs as the target. The purpose was simply to answer:</p><p>“What exactly is EventBridge receiving from Salesforce?”</p><p>The event looked approximately like this:</p><pre>{<br> &quot;version&quot;: &quot;0&quot;,<br> &quot;id&quot;: &quot;…&quot;,<br> &quot;detail-type&quot;: &quot;Order_Submitted__e&quot;,<br> &quot;source&quot;: &quot;aws.partner/salesforce.com/…&quot;,<br> &quot;account&quot;: &quot;…&quot;,<br> &quot;time&quot;: &quot;…&quot;,<br> &quot;region&quot;: &quot;us-east-1&quot;,<br> &quot;resources&quot;: [],<br> &quot;detail&quot;: {<br>     &quot;payload&quot;: {<br>     &quot;OrderId__c&quot;: &quot;ORD-AWS-DEBUG-001&quot;,<br>     &quot;CustomerId__c&quot;: &quot;CUST-AWS-DEBUG-001&quot;,<br>     &quot;Amount__c&quot;: 1250,<br>     &quot;CurrencyCode__c&quot;: &quot;USD&quot;,<br>     &quot;EventVersion__c&quot;: &quot;1.0&quot;,<br>     &quot;CorrelationId__c&quot;: &quot;LAB-AWS-DEBUG-001&quot;<br>     }<br>   }<br>}</pre><p><strong>💡 This was an important learning moment because I could see the actual event contract rather than guessing about it.</strong></p><h3><strong>📦 12. Understand the Event Envelope</strong></h3><p>The EventBridge event has an outer envelope:</p><pre>source<br>detail-type<br>id<br>time<br>region<br>detail</pre><p>Inside detail is the Salesforce payload:</p><p><strong>detail → payload → Salesforce fields</strong></p><p>Conceptually:</p><p><strong>EventBridge Event<br> → detail<br> → payload<br> → OrderId__c<br> → CustomerId__c<br> → Amount__c</strong></p><p>This distinction matters when writing EventBridge rules and when downstream consumers need to extract the actual Salesforce business data.</p><p><strong>🎯 The lesson for me was simple:</strong></p><p>Don’t guess the event structure. Inspect the actual event.</p><h3><strong>✅ 13. Fix the Rule and Test Again</strong></h3><p>After confirming the actual event structure, I updated the SQS rule to explicitly match:</p><p>Salesforce Partner Source + Order_Submitted__e</p><p>I published another test event. This time the complete flow worked:</p><p><strong>Salesforce → Platform Event → Event Relay → EventBridge → EventBridge Rule → SQS</strong></p><p>And the message appeared in the SQS queue.</p><p><strong>🎉 That gave me an end-to-end working event-driven integration.</strong></p><h3><strong>💡 What I Learned</strong></h3><p>This exercise wasn’t really about learning four AWS/Salesforce features. It was about understanding how systems communicate.</p><p>I got hands-on with:</p><p>✅ - Salesforce Platform Events<br>✅ - Salesforce Event Bus<br>✅ - Salesforce Event Channels<br>✅ - Salesforce Named Credentials<br>✅ - Salesforce Event Relay<br>✅ - Amazon EventBridge Partner Event Sources<br>✅ - EventBridge Event Buses and Rules<br>✅ - EventBridge event filtering<br>✅ - Amazon SQS<br>✅ - CloudWatch debugging<br>✅ - Event payloads and contracts</p><p>More importantly, I started seeing integration as a series of boundaries:</p><p><strong>Producer → Event → Relay → Router → Queue → Consumer</strong></p><p>Each boundary has its own responsibility, and each boundary can be independently monitored and troubleshot.</p><h3><strong>🏗️ The Final Architecture</strong></h3><p><strong>Salesforce → Platform Event → Event Bus → Event Channel → Event Relay → Amazon EventBridge → EventBridge Rule → Amazon SQS</strong></p><p>What started as a small learning exercise gave me exposure to concepts that become increasingly important in enterprise systems:</p><p>Loose coupling, asynchronous processing, event routing, durability, observability, security, troubleshooting, and scalability.</p><p>And that’s really the reason I’m exploring <strong>AWS</strong> alongside <strong>Salesforce</strong>.</p><p>I’m still learning Salesforce, and I’m still learning AWS. But I believe understanding how platforms work together is just as important as understanding either platform individually.</p><p>The goal isn’t to become an expert in every technology. It’s to gradually understand enough of the bigger picture to design better systems.</p><h3>⚠️ Cost &amp; Documentation Disclaimer</h3><p>This is a learning/demo setup, and <strong>AWS services such as EventBridge, SQS, and CloudWatch can incur charges depending on usage</strong>, even when using a Free Tier account. Please monitor your AWS billing and Free Tier usage, clean up resources when you’re finished, and use the architecture responsibly.</p><p>For implementation details, limits, availability, and current pricing, always refer to the <strong>official AWS and Salesforce documentation</strong>, as these can change over time.</p><p><strong><em>If this saved you some time or helped you understand the flow better, do consider leaving a 👏 clap and sharing it with your network — it helps more developers find it. Thanks for reading!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85992dcb4f6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Setting Up Google SSO in Salesforce — A Practical Guide]]></title>
            <link>https://blog.stackademic.com/setting-up-google-sso-in-salesforce-a-practical-guide-bc4b38717fc3?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/bc4b38717fc3</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sun, 24 May 2026 05:17:36 GMT</pubDate>
            <atom:updated>2026-05-25T08:59:07.059Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Configure “Log in with Google” on your Salesforce org in six steps</em></p><p>I recently wired Google SSO into a Salesforce dev org. Here is exactly what I did, what broke, and what is actually happening under the hood.</p><h3>⚙️ The Flow in Plain English</h3><p>This uses the <strong>Authorization Code grant</strong> — not Client Credentials (that is machine-to-machine, no user involved).</p><ol><li>🖱️ User clicks “Log in with Google” → browser hits Salesforce’s SSO Init URL</li><li>🔀 Salesforce generates a random state value, builds the Google authorize URL, sends a <strong>302 redirect</strong></li><li>🔑 Browser opens Google login page — user enters credentials</li><li>📬 Google redirects browser back to Salesforce’s Callback URL with a short-lived code and the state echoed back</li><li>🔒 Salesforce verifies state matches (CSRF protection), then <strong>server-to-server</strong> POSTs the code to Google&#39;s token endpoint</li><li>✅ Google returns an id_token JWT — Salesforce validates it, finds the SF user, creates a session</li></ol><h3>🛠️ Six Setup Steps</h3><h3>Step 1 — Create OAuth Credentials in Google Cloud Console 🌐</h3><ul><li><strong>APIs &amp; Services → Credentials → Create Credentials → OAuth 2.0 Client ID</strong></li><li>Application type: <strong>Web application</strong></li><li>Copy the <strong>Client ID</strong> and <strong>Client Secret</strong> — leave Redirect URIs empty for now</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YoMIEuDCRUWRyYMX0cXyCg.png" /></figure><h3>Step 2 — Create Auth Provider in Salesforce ☁️</h3><p><strong>Setup → Identity → Auth. Providers → New</strong></p><p>Fill in the following fields:</p><ul><li><strong>Provider Type</strong> — Google</li><li><strong>Name</strong> — GoogleSSO</li><li><strong>Consumer Key</strong> — Client ID from Google</li><li><strong>Consumer Secret</strong> — Client Secret from Google</li><li><strong>Default Scopes</strong> — openid profile email</li><li><strong>Registration Handler</strong> — Create one (see Step 4)</li></ul><p>Save — Salesforce auto-generates your URLs. The one you need immediately is the <strong>Callback URL</strong>:</p><pre>https://yourorg.my.salesforce.com/services/authcallback/GoogleSSO</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q0735UDg4xTD8CiDoaf_qw.png" /></figure><h3>Step 3 — Register the Callback URL in Google 🔗</h3><p>Edit your OAuth Client in Google Console → paste the Callback URL into <strong>Authorised Redirect URIs</strong>.</p><blockquote><em>⚠️ This is the most commonly missed step. A mismatch causes </em><em>redirect_uri_mismatch and the flow stops entirely.</em></blockquote><h3>Step 4 — Create the Registration Handler in Apex 📝</h3><p>Salesforce needs this to map the Google identity to an existing Salesforce user.</p><pre>global class GoogleRegistrationHandler implements Auth.RegistrationHandler {<br><br>    global User createUser(Id portalId, Auth.UserData data) {<br>        // Try to find existing user by email<br>        List&lt;User&gt; users = [<br>            SELECT Id FROM User <br>            WHERE Email = :data.email AND IsActive = true <br>            LIMIT 1<br>        ];<br>        <br>        if (!users.isEmpty()) {<br>            return users[0]; // Link to existing SF user<br>        }<br>        <br>        // Create new user (JIT provisioning)<br>        User u = new User();<br>        u.Username = data.email + &#39;.google&#39;; // must be unique<br>        u.Email = data.email;<br>        u.FirstName = data.firstName;<br>        u.LastName = data.lastName != null ? data.lastName : &#39;Unknown&#39;;<br>        u.Alias = data.email.left(8);<br>        u.TimeZoneSidKey = &#39;America/Los_Angeles&#39;;<br>        u.LocaleSidKey = &#39;en_US&#39;;<br>        u.EmailEncodingKey = &#39;UTF-8&#39;;<br>        u.LanguageLocaleKey = &#39;en_US&#39;;<br>        u.ProfileId = [SELECT Id FROM Profile WHERE Name = &#39;Standard User&#39; LIMIT 1].Id;<br>        return u;<br>    }<br><br>    global void updateUser(Id userId, Id portalId, Auth.UserData data) {<br>        // Optionally sync name/email on each login<br>        User u = new User(Id = userId);<br>        u.FirstName = data.firstName;<br>        u.LastName = data.lastName;<br>        update u;<br>    }<br>}</pre><p>Go back to the Auth Provider record and set this as the <strong>Registration Handler</strong>.</p><h3>Step 5 — Enable the Login Button via My Domain 🏠</h3><p><strong>Setup → Company Settings → My Domain → Deploy</strong></p><p>Once deployed: <strong>My Domain → Authentication Configuration → check GoogleSSO</strong></p><p>This wires the “Log in with Google” button to your login page.</p><blockquote><em>⚠️ </em><strong><em>Gotcha:</em></strong><em> Salesforce runs a pre-deployment network check. If you are on a corporate VPN, it may fail. Switch to a mobile hotspot temporarily and retry.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1010/1*eW2A6Pzw9dSWlpEdKZ4H-w.png" /></figure><h3>Step 6 — Add Test Users in Google Console 👥</h3><p>While your app is in Testing status, only explicitly added Gmail addresses can log in.</p><p><strong>APIs &amp; Services → OAuth consent screen → Test users → Add Users</strong></p><p>When ready for production, click <strong>Publish App</strong> — no Google review needed for openid profile email scopes.</p><h3>🧪 Testing</h3><p>Paste the <strong>Test-Only Initialization URL</strong> directly in the browser:</p><pre>https://yourorg.my.salesforce.com/services/auth/test/GoogleSSO</pre><p>You should land on Google login → authenticate → land in Salesforce. ✅<br>You might also see user details in XML or JSON.</p><p>❌ <strong>Common errors:</strong></p><p>redirect_uri_mismatch Callback URL in Google does not exactly match SF<br>Registration handler error Check that the user&#39;s email exists in Salesforce<br>Access blocked: app not verified Gmail not added to test users list in Google Console</p><h3>💡 One Thing That Surprised Me</h3><p>Logging out of Gmail does <strong>not</strong> log you out of Salesforce. The two sessions are independent once login completes. Without Single Logout (SLO) configured, the SF session lives until timeout or explicit SF logout.</p><p>To link them: <strong>Setup → Session Settings → Enable Single Logout</strong>, then register the SLO URL back in Google:</p><pre>https://yourorg.my.salesforce.com/services/auth/rp/oidc/logout</pre><h3>🚫 Want to Force Google Login Only?</h3><p>By default, the Salesforce username/password form and the Google SSO button coexist on the login page. If you want to <strong>remove the password option entirely</strong> and make Google the only way in, here is what to do.</p><h3>Remove the Login Form 🗑️</h3><p><strong>Setup → Company Settings → My Domain → Authentication Configuration → Edit</strong></p><p>Under <strong>Authentication Service</strong>, uncheck <strong>Login Form</strong> — leave only <strong>GoogleSSO</strong> checked. Save.</p><p>The username/password fields disappear from your login page. Users only see “Log in with Google.”</p><h3>Enforce SSO at the Profile Level 👤</h3><p>Even with the form removed, a user who knows the direct login URL can potentially bypass it. Lock it down per profile:</p><p><strong>Setup → Profiles → (select profile) → Edit → check “Is Single Sign-On Enabled”</strong></p><p>This tells Salesforce that users on this profile must authenticate via SSO — password login is disallowed for them.</p><h3>⚠️ Critical Warning — Do Not Lock Yourself Out</h3><p>Before enforcing SSO org-wide, always ensure:</p><p>🛡️ <strong>Keep one System Admin profile with Login Form still enabled</strong> — if Google goes down, you need a way back in</p><p>🌐 <strong>Know the bypass URL: </strong><a href="https://login.salesforce.com/"><strong>https://login.salesforce.com</strong></a> — If you get locked out, navigating to https://yourorg.my.salesforce.com/?login forces the standard username and password fields to reappear for System Administrators.</p><p>🧑‍💻 <strong>Test on a non-admin user first</strong> — confirm SSO works before enforcing it on everyoneIf you lock out all admins and Google has an outage, you will be fully locked out of your org. Salesforce Support can recover it, but it takes time and a support ticket.</p><p>💰 The entire setup is free — no paid Google APIs, works on all Salesforce editions including Developer orgs.</p><h3>📌 Disclaimer</h3><p>This article is for <strong>educational purposes only</strong>. The steps and code shared here are based on a personal dev org setup and are meant to help you understand the concepts and get started quickly.</p><p>For enterprise-level implementation, security hardening, and production best practices, always refer to the <strong>Official Salesforce documentation.</strong></p><p><strong><em>If this saved you some time or helped you understand the flow better, do consider leaving a 👏 clap and sharing it with your network — it helps more developers find it. Thanks for reading!</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bc4b38717fc3" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/setting-up-google-sso-in-salesforce-a-practical-guide-bc4b38717fc3">🔐 Setting Up Google SSO in Salesforce — A Practical Guide</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ I Was Tired of Opening the Salesforce Setup Page 20 Times a Day, So I Built This Salesforce…]]></title>
            <link>https://blog.stackademic.com/i-was-tired-of-opening-the-salesforce-setup-page-20-times-a-day-b721e6ed9aa2?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/b721e6ed9aa2</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[developer]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 07:35:54 GMT</pubDate>
            <atom:updated>2026-05-04T07:21:52.853Z</atom:updated>
            <content:encoded><![CDATA[<h4>🚀 <strong>I Was Tired of Opening the Salesforce Setup Page 20 Times a Day, So I Built This </strong><a href="https://chromewebstore.google.com/detail/salesforce-field-inspecto/cbboccbeakafjkgofkimjgolflajjphi"><strong>Salesforce Chrome Extension</strong></a><strong>.</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-Vj6wO7oIJd0rtz_" /><figcaption>Photo by <a href="https://unsplash.com/@jstrippa?utm_source=medium&amp;utm_medium=referral">James Harrison</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>A free Chrome extension that shows you every field detail on hover — <strong>no Setup, no tab-switching, no interruptions.</strong></p><h3>⚡ The Pain Every Salesforce Developer / Admin Knows</h3><p>You’re in the middle of a Flow. Or writing a validation rule. Or debugging an integration.<br>And you need one thing — the API name of a field. Its type. Whether it tracks history. What the picklist values are.</p><p>So you:<br> ➡️ Navigate to Setup<br> ➡️ Find the object<br> ➡️ Find the field<br> ➡️ Copy the value<br> ➡️ Switch back</p><p>And by then, you’ve completely lost your train of thought. It’s not a big deal once. But it happens <strong>dozens of times a day</strong>. And it adds up.</p><h3>💡 There’s a Better Way</h3><p><a href="https://chromewebstore.google.com/detail/salesforce-field-inspecto/cbboccbeakafjkgofkimjgolflajjphi"><strong>Salesforce Field Inspector</strong></a> is a free Chrome extension that surfaces field metadata instantly — right on the record page, on hover.</p><p>✅ No extra tabs<br>✅ No Setup navigation<br>✅ No interruptions</p><p>Just hover over a field and see everything you need.</p><h3>🔍 What You Get on Every Hover</h3><p>The moment you hover over any field on a Lightning record page, a tooltip appears with:</p><ul><li>📌 <strong>API Name</strong> — with a one-click copy button</li><li>🧩 <strong>Field Type</strong> — Text, Lookup, Formula, Picklist, Currency, and more</li><li>🧮 <strong>Formula Expression</strong> — full formula, inline</li><li>🔗 <strong>Relationship Details</strong> — Lookup &amp; Master-Detail (including cascade delete)</li><li>📋 <strong>Picklist Values</strong> — up to 8, shown instantly, click on link to see more</li><li>📏 <strong>Precision, Scale &amp; Length</strong> — critical for integrations</li><li>⚙️ <strong>Field Flags</strong> — Required / Update-able / Createable</li><li>🕒 <strong>History Tracking Status</strong></li><li>🔐 <strong>FLS Button</strong> — check Field Level Security instantly</li></ul><p>All of this, in the time it takes you to hover your mouse.</p><h3>🛠️ Built for How You Actually Work</h3><p>Uses your existing Salesforce browser session</p><ul><li>❌ No separate login</li><li>❌ No API keys</li><li>❌ No setup required</li></ul><p>Under the hood, it uses standard <strong>Salesforce REST and Tooling APIs</strong>, fully respecting your permissions.<br>⚡ Metadata is cached for 5 minutes — fast and efficient without unnecessary API calls.</p><p>🌐 Works across:</p><ul><li>*.salesforce.com</li><li>*.lightning.force.com</li><li>*.force.com</li></ul><p>🧠 Handles Lightning’s Shadow DOM, ensuring reliable field detection even on complex layouts.</p><h3>🔄 Works Alongside Your Existing Tools</h3><p>Already using <strong>Salesforce Inspector Reloaded</strong> or <strong>Salesforce Inspector Advanced</strong>?</p><p>👍 Salesforce Field Inspector integrates seamlessly.</p><p>The <strong>FLS button</strong> opens the field directly in your installed Salesforce Inspector tool and <strong>writes SOQL to export FLS</strong> — keeping your workflow smooth and uninterrupted.</p><h3>🔒 Your Data Stays in Your Org</h3><ul><li>🚫 No data collection</li><li>🚫 No storage</li><li>🚫 No external transmission</li></ul><p>Everything stays within your Salesforce organisation<br>🔍 Full source code is available on <a href="https://github.com/amrit-suman/Salesforce-Field-Inspector">GitHub</a> — verify it yourself.</p><h3>👥 Who Is This For?</h3><ul><li>🧑‍💼 Salesforce Admins (Flows, validation rules, layouts)</li><li>👨‍💻 Developers (Apex, SOQL, integrations)</li><li>🌍 Consultants working across multiple orgs</li><li>😩 Anyone tired of opening Setup repeatedly</li></ul><h3>🎯 Get It Free</h3><p><strong>Salesforce Field Inspector</strong> is available now on the Chrome Web Store — completely free.<br>🔗 Link to <a href="https://chromewebstore.google.com/detail/salesforce-field-inspecto/cbboccbeakafjkgofkimjgolflajjphi"><strong>Salesforce Field Inspector</strong></a><strong><br></strong>💬 Found a bug or want a feature? Open an issue on <a href="https://github.com/amrit-suman/Salesforce-Field-Inspector/issues">GitHub</a> — your feedback shapes what gets built next.</p><h3>⏳ Final Thought</h3><p>If this saves you even <strong>10 minutes a week</strong>, that’s <strong>8+ hours a year</strong> back in your day.</p><p>👉 Go <a href="https://chromewebstore.google.com/detail/salesforce-field-inspecto/cbboccbeakafjkgofkimjgolflajjphi">install</a> it and enjoy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*EY7-LK_eh04b5WBLJ05fmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*4MJUlSaPmxEnVyxz7usKAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*1deNiZRKn-bOCq6ENJwh4A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/1*lB1OglRXn_sD9Hhs1ZUd5g.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b721e6ed9aa2" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/i-was-tired-of-opening-the-salesforce-setup-page-20-times-a-day-b721e6ed9aa2">🚀 I Was Tired of Opening the Salesforce Setup Page 20 Times a Day, So I Built This Salesforce…</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Salesforce to Spring Boot in Real Time: Streaming Platform Events with CometD]]></title>
            <link>https://blog.stackademic.com/salesforce-to-spring-boot-in-real-time-streaming-platform-events-with-cometd-f49124208d78?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/f49124208d78</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[event-driven-architecture]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[spring-boot]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sat, 28 Feb 2026 08:06:53 GMT</pubDate>
            <atom:updated>2026-03-06T07:54:22.552Z</atom:updated>
            <content:encoded><![CDATA[<p>Modern enterprise systems increasingly rely on <strong>event-driven architectures</strong> to react to changes in real time. If you’re working with Salesforce Platform Events and want to consume them from a Java backend, this project — <strong>SFDCPlatformEventsApplication</strong> — demonstrates a clean approach using <strong>Spring Boot</strong> and the <strong>CometD/Bayeux protocol</strong>.</p><p>This article walks through the architecture, flow, and design decisions behind the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JMmQP4-AhzO4cxeZJUj4tg.png" /></figure><h3>Why Platform Events + Spring Boot?</h3><p>Salesforce Platform Events allow you to publish and subscribe to business events (like order creation, payment updates, or status changes) in near real-time.</p><p>Instead of polling Salesforce APIs:</p><ul><li>Your backend <strong>subscribes once</strong></li><li>Salesforce <strong>pushes events instantly</strong></li><li>Your application reacts immediately</li></ul><p>This project shows how to:</p><ul><li>Authenticate using OAuth2 Client Credentials</li><li>Connect securely to Salesforce’s CometD endpoint</li><li>Subscribe to event channels</li><li>Process events in real time</li></ul><h3>Architecture Overview</h3><p>At a high level, the flow looks like this:</p><ol><li><strong>Spring Boot app starts</strong></li><li>Application authenticates with Salesforce (OAuth2 Client Credentials)</li><li>Access token + instance URL are retrieved</li><li>CometD client is created with SSL/TLS configuration</li><li>Secure connection established to: https://&lt;instance&gt;/cometd/&lt;api-version&gt;</li><li>Application subscribes to a platform event channel</li><li>Events are streamed and processed live</li></ol><h3>Core Technologies Used</h3><h3>Framework</h3><ul><li>Spring Boot 4.0.3</li></ul><h3>Event Transport</h3><ul><li>Bayeux Protocol</li><li>CometD 8.0.9</li></ul><h3>HTTP &amp; Transport Layer</h3><ul><li>Jetty 12.0.21</li></ul><p>These libraries work together to enable HTTP/2 support, secure TLS configuration, and persistent streaming connections.</p><h3>Authentication Flow (OAuth2 Client Credentials)</h3><p>Authentication is handled by SalesforceOAuthService.java.</p><h3>What It Does</h3><ul><li>Sends a POST request to: {login-url}/services/oauth2/token</li><li>Uses:</li><li>grant_type=client_credentials</li><li>client_id</li><li>client_secret</li><li>Receives:</li><li>access_token</li><li>instance_url</li></ul><h3>Implementation Highlights</h3><ul><li>Uses Spring’s RestTemplate</li><li>Proper form encoding via LinkedMultiValueMap</li><li>Content-Type: application/x-www-form-urlencoded</li></ul><p>This approach keeps authentication logic clean and reusable.</p><h3>Real-Time Subscription Flow</h3><p>The heart of the application is PlatformEventSubscriber.java.</p><h3>Lifecycle</h3><p>The subscription process is triggered automatically on application startup:</p><pre>@EventListener(ContextRefreshedEvent.class)</pre><p>It also uses:</p><pre>@Async</pre><p>This ensures:</p><ul><li>Spring Boot starts normally</li><li>Subscription runs in a background thread</li><li>The app remains responsive</li></ul><h3>Creating the CometD Client</h3><p>The getBayeuxClient() method:</p><ol><li>Configures SSL/TLS using Jetty’s SslContextFactory</li><li>Initializes HttpClientTransportDynamic (HTTP/2 support)</li><li>Starts Jetty HttpClient</li><li>Builds CometD endpoint: {instanceUrl}/cometd/{apiVersion}</li></ol><p>5. Injects Authorization header: Authorization: Bearer &lt;access_token&gt;</p><p>This ensures secure, persistent communication with Salesforce.</p><h3>Subscribing to an Event</h3><p>The example subscribes to:</p><pre>/event/Order_Event__e</pre><p>When Salesforce publishes this event, the lambda callback executes:</p><pre>(channel, message) -&gt; {<br>    System.out.println(&quot;Received event: &quot; + message.getData());<br>}</pre><p>This is where your business logic would go:</p><ul><li>Save to database</li><li>Trigger workflows</li><li>Call external systems</li><li>Update analytics pipelines</li></ul><h3>Configuration Best Practices</h3><p>The project supports two configuration modes:</p><h3>✅ Environment Variables (Production Recommended)</h3><pre>export SALESFORCE_LOGIN_URL=...<br>export SALESFORCE_CLIENT_ID=...<br>export SALESFORCE_CLIENT_SECRET=...</pre><h3>⚠️ Local Properties (Development Only)</h3><p>Stored in:</p><pre>application-local.properties</pre><p>Important: Credentials are excluded via .gitignore.</p><h3>Project Structure</h3><pre>src/<br>├── main/<br>│   ├── java/com/example/sfdcPlatformEvents/<br>│   │   ├── SfdcPlatformEventsApplication.java<br>│   │   ├── SalesforceOAuthService.java<br>│   │   └── PlatformEventSubscriber.java<br>│   └── resources/<br>│       └── application.properties<br>└── test/</pre><p>The separation of concerns is clean:</p><p>ClassResponsibility<br>SfdcPlatformEventsApplicationBootstrapsSpring<br>SalesforceOAuthServiceHandlesAuthentication<br>PlatformEventSubscriberManages streaming &amp; events</p><h3>Troubleshooting Guide</h3><h3>🔐 Unauthorized Errors</h3><p>Check:</p><ul><li>Client ID &amp; Secret</li><li>OAuth app permissions</li><li>Token retrieval success</li></ul><h3>🔒 SSL Handshake Failures</h3><ul><li>Ensure valid Salesforce SSL cert</li><li>Check firewall rules allow outbound HTTPS</li></ul><h3>❌ Channel Not Found</h3><p>Make sure:</p><ul><li>Platform Event exists</li><li>Channel name includes __e</li><li>User has subscription permissions</li></ul><h3>⚠️ Dependency Conflicts</h3><p>If you see:</p><ul><li>NoSuchMethodError</li><li>ClassCastException</li></ul><p>Verify compatibility between:</p><ul><li>CometD 8.x</li><li>Jetty 12.x</li></ul><p>Run:</p><pre>./mvnw dependency:tree</pre><h3>Why This Design Works Well</h3><p>This implementation follows strong engineering principles:</p><ul><li>✅ Clear separation of concerns</li><li>✅ Asynchronous startup handling</li><li>✅ Secure OAuth2 flow</li><li>✅ Production-ready configuration approach</li><li>✅ Version-aligned dependencies</li><li>✅ Extensible for multiple channels</li></ul><p>It avoids polling and embraces event-driven architecture correctly.</p><h3>Suggested Enhancements</h3><p>To take this from demo to production:</p><ul><li>Implement exponential backoff reconnect logic</li><li>Add structured logging</li><li>Integrate metrics (Micrometer/Prometheus)</li><li>Support multiple event channels</li><li>Add graceful shutdown hooks</li><li>Persist replay IDs for durable subscriptions</li></ul><h3>Final Thoughts</h3><p>This Spring Boot application provides a practical and modern blueprint for consuming Salesforce Platform Events using CometD. It bridges Salesforce’s event ecosystem with Java microservices in a secure, scalable way.</p><p>If you’re building:</p><ul><li>Order processing systems</li><li>Integration hubs</li><li>Real-time analytics pipelines</li><li>Event-driven microservices</li></ul><p>This architecture gives you a solid foundation.<br>Github Repo : <a href="https://github.com/amrit-suman/SFDCSpringBootPlatformEventsApplication">https://github.com/amrit-suman/SFDCSpringBootPlatformEventsApplication</a> 😃</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f49124208d78" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/salesforce-to-spring-boot-in-real-time-streaming-platform-events-with-cometd-f49124208d78">🚀 Salesforce to Spring Boot in Real Time: Streaming Platform Events with CometD</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Inside a Salesforce Chrome Extension: Architecture, APIs, and Security Risks]]></title>
            <link>https://blog.stackademic.com/inside-a-salesforce-chrome-extension-architecture-apis-and-security-risks-109a6949ae48?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/109a6949ae48</guid>
            <category><![CDATA[chrome-extension]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <category><![CDATA[javscript]]></category>
            <category><![CDATA[salesforce]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sun, 18 Jan 2026 12:31:21 GMT</pubDate>
            <atom:updated>2026-01-20T17:43:48.240Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*750hJhCTWoQErX2Tv5iDKA.png" /></figure><p>Salesforce developers frequently need quick access to org data — whether to inspect records, test SOQL queries, or debug integrations. While tools like Inspector exist, building your <strong>own Chrome extension</strong> is a great way to deeply understand how Salesforce REST APIs and browser extensions work together.</p><p><strong><em>Required : A Salesforce Developer Edition Org, VS Code, Basic Knowledge of Salesforce Org, REST API’s and JavaScript.</em></strong></p><p>In this article, we’ll build a <strong>simple Salesforce Chrome extension</strong> that:</p><ul><li>Reads the active Salesforce <strong>session ID (</strong><strong>sid)</strong> from browser cookies</li><li>Uses it to call the Salesforce REST API</li><li>Displays queried data directly inside the extension popup</li></ul><p>We’ll also clearly explain <strong>why using session IDs is dangerous</strong> and when this approach should (and should not) be used.</p><h3>⚠️ Important Disclaimer (Read First)</h3><p>This extension uses the Salesforce <strong>session ID directly</strong>, which:</p><ul><li>Is meant for <strong>learning and internal tools only</strong></li><li>Is <strong>not suitable for production use</strong></li></ul><p>For real-world applications, Salesforce strongly recommends OAuth-based authentication.</p><h3>🧠 How This Extension Works</h3><p><strong>At a high level, the flow looks like this:</strong></p><ol><li>User logs into Salesforce in the browser</li><li>Chrome extension reads the sid cookie</li><li>Session ID is passed to the background script</li><li>Background script calls Salesforce REST API</li><li>API response is shown in the popup UI</li></ol><p>salesforce-chrome-extension/<br>│<br>├── manifest.json<br>├── popup.html<br>├── popup.js<br>├── background.js<br>├── env.js<br>└── README.md</p><h3>📦 Chrome Manifest (manifest.json)</h3><p>This extension uses <strong>Manifest V3</strong>.</p><pre>{<br>  &quot;manifest_version&quot;: 3,<br>  &quot;name&quot;: &quot;Salesforce API Caller&quot;,<br>  &quot;version&quot;: &quot;1.0&quot;,<br>  &quot;description&quot;: &quot;Call Salesforce APIs using session ID without CORS issues&quot;,<br>  &quot;permissions&quot;: [<br>    &quot;identity&quot;,<br>    &quot;activeTab&quot;,<br>    &quot;scripting&quot;,<br>    &quot;storage&quot;,<br>    &quot;cookies&quot;<br>  ],<br>  &quot;host_permissions&quot;: [<br>    &quot;https://*.salesforce.com/*&quot;<br>  ],<br>  &quot;background&quot;: {<br>    &quot;service_worker&quot;: &quot;background.js&quot;,<br>    &quot;type&quot;: &quot;module&quot;<br>  },<br>  &quot;action&quot;: {<br>    &quot;default_popup&quot;: &quot;popup.html&quot;<br>  }<br>}</pre><h3>🌍 Environment Configuration (env.js)</h3><p>Store your Salesforce instance URL in one place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I9ylYoyKyiLCebnb-lAhfA.png" /></figure><h3>🖼️ Popup UI (popup.html)</h3><p>This file defines the extension’s user interface.</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;title&gt;Salesforce API Caller&lt;/title&gt;<br>  &lt;style&gt;<br>    body {font-family: Arial;padding: 1px;width: 1000px;height: 1000px;}<br>    button {padding: 5px 10px;margin-top: 10px;}<br>    pre {background: #f4f4f4;padding: 6px;font-size: 12px;<br>      white-space: pre-wrap !important;<br>      word-break: break-word !important;<br>      overflow-wrap: anywhere !important;<br>      max-height: 1000px;<br>      overflow-y: auto;<br>      overflow-x: hidden;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;h4&gt;Call Salesforce API&lt;/h4&gt;<br>  &lt;button id=&quot;callApi&quot;&gt;Fetch Accounts&lt;/button&gt;<br>  &lt;pre id=&quot;result&quot;&gt;&lt;/pre&gt;<br>  &lt;script type=&quot;module&quot; src=&quot;popup.js&quot;&gt;&lt;/script&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h3>🍪 Reading the Salesforce Session ID (popup.js)</h3><p>The popup script reads the sid cookie and sends it to the background service worker.</p><pre>import { myInstanceUrl } from &quot;./env.js&quot;;<br><br>document.getElementById(&#39;callApi&#39;).addEventListener(&#39;click&#39;, () =&gt; {<br>  console.log(&quot;Cookie&quot;);<br><br>  chrome.cookies.get({<br>    url: myInstanceUrl.instanceUrl, // Must be a full URL<br>    name: &#39;sid&#39;<br>  }, (cookie) =&gt; {<br><br>    if (cookie) {<br>      console.log(`Found cookie:`, cookie.value);<br><br>      let sessionId = cookie.value;<br>      chrome.runtime.sendMessage({ action: &#39;fetchAccounts&#39;, sessionId }, (response) =&gt; {<br>        if (response.error) {<br>          document.getElementById(&#39;result&#39;).textContent = &#39;Error: &#39; + response.error;<br>        } else {<br>          const rawResponse = response.data;<br>          const parsedJson = JSON.parse(rawResponse);<br>          document.getElementById(&#39;result&#39;).textContent = JSON.stringify(parsedJson, null, 2);<br>        }<br>      });<br>    } else {<br>      console.log(`Cookie not found.`);<br>    }<br>  });<br>});</pre><h3>🌐 Calling Salesforce REST API (background.js)</h3><p>All API calls are handled by the background script.</p><pre>import { myInstanceUrl } from &quot;./env.js&quot;;<br><br>chrome.runtime.onMessage.addListener((message, sender, sendResponse) =&gt; {<br><br>  if (message.action === &#39;fetchAccounts&#39;) {<br>    const sessionId = message.sessionId;<br>    const instanceUrl = myInstanceUrl.instanceUrl;<br>    fetch(`${instanceUrl}/services/data/v64.0/query/?q=SELECT+Id,Name+FROM+Account+LIMIT+5`, {<br>      headers: {<br>        &#39;Authorization&#39;: &#39;Bearer &#39; + sessionId,<br>        &#39;Content-Type&#39;: &#39;application/json&#39;<br>      }<br>    })<br>    .then(res =&gt; res.text())<br>    .then(data =&gt; {sendResponse({ data })<br>    })<br>    .catch(err =&gt; sendResponse({ error: err.message }));<br><br>    return true;<br>  }<br>});</pre><h3>🧪 How to Load the Extension in Chrome</h3><ol><li>Open <strong>Google Chrome</strong></li><li>Navigate to: chrome://extensions</li><li>Enable <strong>Developer mode</strong></li><li>Click <strong>Load unpacked</strong></li><li>Select your extension folder</li><li>Log into Salesforce in another tab</li><li>Click the extension → <strong>Fetch Accounts</strong></li></ol><p>You should now see Account data rendered as JSON.</p><h3>🔐 Security Risks of Using Salesforce Session ID</h3><p>Using session IDs is convenient — but <strong>extremely risky</strong>.</p><p>1️⃣ Session ID = Full User Access<br>A session ID is equivalent to the user’s authenticated identity. Anyone who gets it can act as that user via API.</p><p>2️⃣ Session Hijacking<br>If your extension, logs, or another extension leaks the session ID, attackers can reuse it without MFA or SSO.</p><p>3️⃣ No Permission Scoping<br>Unlike OAuth tokens, session IDs:</p><ul><li>Cannot be limited to read-only</li><li>Cannot restrict API access</li><li>Automatically inherit all user permissions</li></ul><p>4️⃣ MFA &amp; SSO Are Bypassed<br>Once issued, a session ID does not re-check MFA or identity provider authentication.</p><p>5️⃣ Hard to Revoke<br>There is no clean way to revoke a single session ID without logging out or resetting the user’s credentials.</p><p>6️⃣ Violates Salesforce Security Best Practices<br>Salesforce recommends OAuth for all external integrations. Session reuse:</p><ul><li>Fails enterprise security reviews</li><li>Is not AppExchange compliant</li><li>Is unsafe for public extensions</li></ul><h3>✅ When Is This Approach Acceptable?</h3><p>Using session IDs is acceptable <strong>only when</strong>:</p><ul><li>The extension is <strong>private</strong></li><li>Used for <strong>individual purposes</strong></li><li>Runs in <strong>sandbox or dev orgs</strong></li></ul><h3>🧠 Final Thoughts</h3><p>This project is an excellent way to understand:</p><ul><li>Salesforce REST APIs</li><li>Chrome extension architecture</li><li>Real-world authentication pitfalls</li></ul><p>But remember : <strong><em>Session IDs are powerful shortcuts — not secure foundations.<br></em></strong>If you’re building serious tools on <strong>Salesforce</strong>, OAuth is the only sustainable path forward.</p><p>This article demonstrates a <strong>simple and functional</strong> way to create your first Salesforce Chrome Extension. To keep things concise, advanced best practices for integration might have been skipped.<br>Feel free to share observations or any issues in the comments.</p><p>Github Repo : <a href="https://github.com/amrit-github/Chrome_Extension_SFDC_API/blob/main/README.md">https://github.com/amrit-github/Chrome_Extension_SFDC_API/blob/main/README.md</a></p><p><strong>LIKE</strong> this post if it was worth your time! 😃 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=109a6949ae48" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/inside-a-salesforce-chrome-extension-architecture-apis-and-security-risks-109a6949ae48">🚀 Inside a Salesforce Chrome Extension: Architecture, APIs, and Security Risks</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Migrating from Pub-Sub to Lightning Message Service (LMS) in Salesforce LWC]]></title>
            <link>https://blog.stackademic.com/migrating-from-pub-sub-to-lightning-message-service-lms-in-salesforce-lwc-93274bfc2d44?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/93274bfc2d44</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[salesforce-lightning]]></category>
            <category><![CDATA[migration]]></category>
            <category><![CDATA[pub-sub]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sun, 14 Sep 2025 14:54:58 GMT</pubDate>
            <atom:updated>2025-09-14T17:28:22.051Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E50CePKGkjvChWXt" /><figcaption>Photo by <a href="https://unsplash.com/@thommilkovic?utm_source=medium&amp;utm_medium=referral">Thom Milkovic</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>If you’ve been using the <strong>Pub-Sub model</strong> for component communication in LWC, it’s time to modernize. Salesforce officially recommends the <strong>Lightning Message Service (LMS)</strong> for app-wide communication. Here’s how you can migrate step by step.</p><h4>🛑 The Old Pub-Sub Way</h4><p>Publisher (cartPublisher.js):</p><pre>import { LightningElement } from &#39;lwc&#39;;<br>import { publish } from &#39;c/pubsub&#39;;<br><br>export default class CartPublisher extends LightningElement {<br>    addToCart() {<br>        publish(&#39;cartUpdate&#39;, { productId: &#39;P123&#39;, name: &#39;Laptop&#39; });<br>    }<br>}</pre><p>Subscriber (cartSubscriber.js):</p><pre>import { LightningElement } from &#39;lwc&#39;;<br>import { subscribe } from &#39;c/pubsub&#39;;<br><br>export default class CartSubscriber extends LightningElement {<br>    connectedCallback() {<br>        subscribe(&#39;cartUpdate&#39;, (data) =&gt; {<br>            console.log(&#39;Product added:&#39;, data);<br>        });<br>    }<br>}</pre><p>👉 Works fine, but <strong>only within a single Lightning page</strong>.</p><p><strong>✅ Migrating to LMS</strong><br>1. Create a Message Channel<br>cartMessageChannel.messageChannel-meta.xml</p><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<br>&lt;MessageChannel xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot;&gt;<br>    &lt;description&gt;Cart update channel&lt;/description&gt;<br>    &lt;isExposed&gt;true&lt;/isExposed&gt;<br>    &lt;lightningMessageFields&gt;<br>        &lt;fieldName&gt;productId&lt;/fieldName&gt;<br>    &lt;/lightningMessageFields&gt;<br>    &lt;lightningMessageFields&gt;<br>        &lt;fieldName&gt;name&lt;/fieldName&gt;<br>    &lt;/lightningMessageFields&gt;<br>&lt;/MessageChannel&gt;</pre><p>2. Update Publisher</p><pre>import { LightningElement, wire } from &#39;lwc&#39;;<br>import { publish, MessageContext } from &#39;lightning/messageService&#39;;<br>import CART_CHANNEL from &#39;@salesforce/messageChannel/cartMessageChannel__c&#39;;<br><br>export default class CartPublisher extends LightningElement {<br>    @wire(MessageContext) messageContext;<br><br>    addToCart() {<br>        publish(this.messageContext, CART_CHANNEL, {<br>            productId: &#39;P123&#39;,<br>            name: &#39;Laptop&#39;<br>        });<br>    }<br>}</pre><p>3. Update Subscriber</p><pre>import { LightningElement, wire } from &#39;lwc&#39;;<br>import { subscribe, MessageContext } from &#39;lightning/messageService&#39;;<br>import CART_CHANNEL from &#39;@salesforce/messageChannel/cartMessageChannel__c&#39;;<br><br>export default class CartSubscriber extends LightningElement {<br>    @wire(MessageContext) messageContext;<br>    subscription = null;<br><br>    connectedCallback() {<br>        this.subscription = subscribe(<br>            this.messageContext,<br>            CART_CHANNEL,<br>            (message) =&gt; {<br>                console.log(&#39;Product added:&#39;, message);<br>            }<br>        );<br>    }<br>}</pre><p>🔍 Side-by-Side Migration</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IQfbPUleV7_ZiVQQTY2u9w.png" /></figure><h4>🚀 Benefits of LMS</h4><ul><li><strong>Global messaging</strong> across pages and frameworks.</li><li><strong>Official Salesforce support</strong> (unlike Pub-Sub).</li><li><strong>Future-proof</strong> for large-scale apps.</li></ul><h4><strong>✅ Takeaway</strong></h4><ul><li><strong>Pub-Sub</strong> = great for prototypes.</li><li><strong>LMS</strong> = official, global, and production-ready.</li></ul><p>If your project still uses Pub-Sub, migrating is straightforward — usually just replacing your publish/subscribe calls with LMS equivalents.</p><p><strong>Happy Coding !!!</strong></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93274bfc2d44" width="1" height="1" alt=""><hr><p><a href="https://blog.stackademic.com/migrating-from-pub-sub-to-lightning-message-service-lms-in-salesforce-lwc-93274bfc2d44">🔄 Migrating from Pub-Sub to Lightning Message Service (LMS) in Salesforce LWC</a> was originally published in <a href="https://blog.stackademic.com/">Stackademic</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ How to Make Most from Your Team’s Salesforce Deployment Tracker Like a Pro ✨]]></title>
            <link>https://medium.com/@amrit-suman/how-to-make-most-from-your-teams-salesforce-deployment-tracker-like-a-pro-12ac44a42efc?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/12ac44a42efc</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sun, 10 Aug 2025 07:54:53 GMT</pubDate>
            <atom:updated>2025-08-10T08:01:44.164Z</atom:updated>
            <content:encoded><![CDATA[<h3>🚀 <strong>How to Make Most from Your Team’s Salesforce Deployment Tracker </strong>📝✨</h3><p>Managing deployments in Salesforce often feels like juggling flaming swords 🔥🤹‍♂️ — especially when your team is tracking everything in a <strong>shared Excel sheet</strong> 📊.<br> In this article, I’ll show you how to <strong>transform that messy Excel tracker into automated </strong><strong>package.xml files</strong> for each <strong>Jira ticket</strong> and <strong>combined package.xml</strong>🎯 — all using <strong>Node.js</strong> 🖥️.</p><blockquote><strong><em>📌 Problem Statement 😵‍💫</em></strong></blockquote><p>Most Salesforce teams maintain an Excel deployment tracker with columns like:</p><p>📄 <strong>Component Name<br></strong>🧩 <strong>Component Type<br></strong>🎟 <strong>Jira ID</strong></p><p>When it’s time to create a package.xml, we face:</p><p>❌ <strong>Duplicate component types<br></strong>❌ <strong>Manual, error-prone copy-paste<br></strong>❌ <strong>No easy way to split packages by Jira ID</strong></p><blockquote><strong><em>💡 Our Goal 🎯</em></strong></blockquote><p>We want to <strong>read the Excel file</strong> → <strong>group by Jira ID</strong> → <strong>generate one or more </strong><strong>package.xml for all components and for each ticket</strong> automatically.</p><h3>🛠 Tools &amp; Technologies 🧰</h3><ul><li>📊 <strong>Excel</strong> for tracking components</li><li>🟢 <strong>Node.js</strong> for automation</li><li>📦 <strong>xlsx</strong> npm package for reading Excel files</li><li>⚙ <strong>fs</strong> module for writing XML files</li></ul><blockquote><strong><em>🗂 Sample Excel Format 📑</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*BT4PAYKbnTWPJ1DUjTClhg.png" /></figure><blockquote><strong><em>🖼 Diagram — From Excel to Deployment 🚚</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CZdjDOQ5xdhpYjSSOtur6A.png" /></figure><h4>💻 Node.js Script Example 👨‍💻</h4><h4>✨ This code will generate a common package.xml for the all components.</h4><pre>const XLSX = require(&quot;xlsx&quot;);<br>const fs = require(&quot;fs&quot;);<br><br>// ===== CONFIG =====<br>const excelFile = &quot;deployment_tracker.xlsx&quot;; // Your Excel file path<br>const componentCol = &quot;Component Name&quot;;       // Exact column header<br>const typeCol = &quot;Component Type&quot;;            // Exact column header<br>const outputFile = &quot;package.xml&quot;;            // Output XML file<br>const apiVersion = &quot;59.0&quot;;                   // Salesforce API version<br>// ==================<br><br>// Read the Excel file<br>const workbook = XLSX.readFile(excelFile);<br>const sheetName = workbook.SheetNames[0];<br>const sheet = workbook.Sheets[sheetName];<br>const rows = XLSX.utils.sheet_to_json(sheet);<br><br>// Group by component type<br>const grouped = {};<br>rows.forEach(row =&gt; {<br>    const type = row[typeCol];<br>    const name = row[componentCol];<br><br>    if (!type || !name) return; // skip blank rows<br><br>    if (!grouped[type]) {<br>        grouped[type] = new Set();<br>    }<br>    grouped[type].add(name);<br>});<br><br>// Build XML<br>let xml = `&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n`;<br>xml += `&lt;Package xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot;&gt;\n`;<br><br>Object.keys(grouped).forEach(type =&gt; {<br>    xml += `    &lt;types&gt;\n`;<br>    [...grouped[type]].sort().forEach(member =&gt; {<br>        xml += `        &lt;members&gt;${member}&lt;/members&gt;\n`;<br>    });<br>    xml += `        &lt;name&gt;${type}&lt;/name&gt;\n`;<br>    xml += `    &lt;/types&gt;\n`;<br>});<br><br>xml += `    &lt;version&gt;${apiVersion}&lt;/version&gt;\n`;<br>xml += `&lt;/Package&gt;`;<br><br>// Write to file<br>fs.writeFileSync(outputFile, xml, &quot;utf8&quot;);<br><br>console.log(`✅ package.xml generated: ${outputFile}`);</pre><h4>✨ This code will generate a separate package.xml for the all components grouped by Jira Ids.</h4><pre>const XLSX = require(&quot;xlsx&quot;);<br>const fs = require(&quot;fs&quot;);<br><br>// ===== CONFIG =====<br>const excelFile = &quot;deployment_tracker.xlsx&quot;; // Your Excel file path<br>const componentCol = &quot;Component Name&quot;;       // Column name in Excel<br>const typeCol = &quot;Component Type&quot;;            // Column name in Excel<br>const jiraCol = &quot;Jira Id&quot;;                   // Column name in Excel<br>const apiVersion = &quot;59.0&quot;;                   // Salesforce API version<br>// ==================<br><br>// Read the Excel file<br>const workbook = XLSX.readFile(excelFile);<br>const sheetName = workbook.SheetNames[0];<br>const sheet = workbook.Sheets[sheetName];<br>const rows = XLSX.utils.sheet_to_json(sheet);<br><br>// Group data by Jira Id<br>const jiraGroups = {};<br>rows.forEach(row =&gt; {<br>    const jiraId = row[jiraCol];<br>    const type = row[typeCol];<br>    const name = row[componentCol];<br><br>    if (!jiraId || !type || !name) return;<br><br>    if (!jiraGroups[jiraId]) {<br>        jiraGroups[jiraId] = {};<br>    }<br>    if (!jiraGroups[jiraId][type]) {<br>        jiraGroups[jiraId][type] = new Set();<br>    }<br>    jiraGroups[jiraId][type].add(name);<br>});<br><br>// Generate package.xml for each Jira Id<br>Object.keys(jiraGroups).forEach(jiraId =&gt; {<br>    let xml = `&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;\n`;<br>    xml += `&lt;Package xmlns=&quot;http://soap.sforce.com/2006/04/metadata&quot;&gt;\n`;<br><br>    Object.keys(jiraGroups[jiraId]).forEach(type =&gt; {<br>        xml += `    &lt;types&gt;\n`;<br>        [...jiraGroups[jiraId][type]].sort().forEach(member =&gt; {<br>            xml += `        &lt;members&gt;${member}&lt;/members&gt;\n`;<br>        });<br>        xml += `        &lt;name&gt;${type}&lt;/name&gt;\n`;<br>        xml += `    &lt;/types&gt;\n`;<br>    });<br><br>    xml += `    &lt;version&gt;${apiVersion}&lt;/version&gt;\n`;<br>    xml += `&lt;/Package&gt;`;<br><br>    const outputFile = `package_${jiraId}.xml`;<br>    fs.writeFileSync(outputFile, xml, &quot;utf8&quot;);<br>    console.log(`✅ Generated: ${outputFile}`);<br>});</pre><blockquote><strong><em>🚀 Benefits 🌟</em></strong></blockquote><ul><li>⚡ <strong>Faster deployments</strong> — no more manual typing</li><li>🛡 <strong>Reduced human error</strong> — no missed components</li><li>📂 <strong>Organized by Jira ticket</strong> — clear separation of changes</li></ul><blockquote><strong><em>🏁 Conclusion 🎉</em></strong></blockquote><p>With just <strong>Node.js</strong> + a small script, your team can:<br> ✅ Save multiple manual edits to package.xml<br> ✅ Keep package.xml files consistent<br> ✅ Handle multiple Jira tickets like a pro 💪</p><p><strong>Happy Coding !!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=12ac44a42efc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[ Returning Multiple data from Apex to LWC Using Maps in One call to Server]]></title>
            <link>https://aws.plainenglish.io/returning-multiple-data-from-apex-to-lwc-using-map-in-single-call-to-server-c752a206979f?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/c752a206979f</guid>
            <category><![CDATA[salesforce-apex]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[backend]]></category>
            <category><![CDATA[salesforce-productivity]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sat, 02 Aug 2025 11:08:02 GMT</pubDate>
            <atom:updated>2025-08-14T00:24:48.301Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SkTO0UjmuHanac_z" /><figcaption>Photo by <a href="https://unsplash.com/@jacksonsophat?utm_source=medium&amp;utm_medium=referral">Jackson Sophat</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When building <strong>Lightning Web Components (LWC)</strong>, we often need to return more than one value from Apex. A common way is to create a wrapper class, but that adds extra code for simple use cases.</p><p>Instead, we can use <strong>Map&lt;String, Object&gt;</strong> to return multiple values in a <strong>JSON‑like</strong> structure. This approach is flexible, lightweight, and closer to how modern JavaScript developers work with APIs.</p><p>In this article, we’ll see:</p><ul><li>How to return multiple values from Apex to LWC using Map&lt;String, Object&gt;.</li><li>A structured way of handling <strong>success and errors</strong> using message and response.</li><li>Risks of this approach and best practices.</li></ul><blockquote><strong><em>🔹 Why </em></strong><strong><em>Map&lt;String, Object&gt;?</em></strong></blockquote><p>In Apex, a Map&lt;String, Object&gt; automatically converts to a JSON object when sent to LWC. This means your LWC receives a simple JavaScript object that you can directly work with.</p><p>We’ll follow this structure:</p><pre>{<br>  &quot;message&quot;: &quot;success&quot; | &quot;error&quot;,<br>  &quot;response&quot;: { ... data or error details ... }<br>}</pre><p>This makes your contract between Apex ↔ LWC <strong>consistent and predictable</strong>.</p><blockquote><strong><em>📌 Apex: Returning Multiple Values</em></strong></blockquote><p>Here’s an example Apex controller:</p><pre>public with sharing class AccountController {<br><br>    @AuraEnabled(cacheable=true)<br>    public static Map&lt;String, Object&gt; getAccountDetails(Id accountId) {<br>        Map&lt;String, Object&gt; result = new Map&lt;String, Object&gt;();<br><br>        try {<br>            Account acc = [<br>                SELECT Id, Name, Industry, Phone <br>                FROM Account <br>                WHERE Id = :accountId<br>                LIMIT 1<br>            ];<br><br>            result.put(&#39;message&#39;, &#39;success&#39;);<br>            result.put(&#39;response&#39;, acc);<br><br>        } catch(QueryException qe) {<br>            result.put(&#39;message&#39;, &#39;error&#39;);<br>            result.put(&#39;response&#39;, &#39;No account found for Id: &#39; + accountId);<br>        } catch(Exception e) {<br>            result.put(&#39;message&#39;, &#39;error&#39;);<br>            result.put(&#39;response&#39;, &#39;Unexpected error: &#39; + e.getMessage());<br>        }<br><br>        return result;<br>    }<br>}</pre><blockquote><strong><em>✅ Key Points</em></strong></blockquote><ul><li>message is always &quot;success&quot; or &quot;error&quot;.</li><li>response contains the actual payload (data or error details).</li><li>Keeps LWC logic simple — it only checks message.</li></ul><p>📌 <strong>LWC JavaScript: Handling the Response</strong></p><pre>import { LightningElement, api, wire } from &#39;lwc&#39;;<br>import getAccountDetails from &#39;@salesforce/apex/AccountController.getAccountDetails&#39;;<br><br>export default class AccountDetails extends LightningElement {<br>    @api recordId;<br>    accountData;<br>    error;<br><br>    @wire(getAccountDetails, { accountId: &#39;$recordId&#39; })<br>    wiredAccount({ error, data }) {<br>        if (data) {<br>            if (data.message === &#39;success&#39;) {<br>                this.accountData = data.response;<br>                this.error = undefined;<br>            } else {<br>                this.error = data.response; // error string<br>            }<br>        } else if (error) {<br>            this.error = &#39;Failed to fetch data: &#39; + error.body.message;<br>        }<br>    }<br>}</pre><blockquote><strong><em>💡 Actual Use Case</em></strong></blockquote><p>Imagine you need to return <strong>an Account plus related Contacts</strong>. With the same structure:</p><pre>responseData.put(&#39;account&#39;, acc);<br>responseData.put(&#39;contacts&#39;, [<br>    SELECT Id, Name, Email FROM Contact WHERE AccountId = :accountId<br>]);</pre><p><strong>LWC will then receive:</strong></p><pre>{<br>  &quot;message&quot;: &quot;success&quot;,<br>  &quot;response&quot;: {<br>    &quot;account&quot;: { &quot;Id&quot;: &quot;...&quot;, &quot;Name&quot;: &quot;Acme Corp&quot; },<br>    &quot;contacts&quot;: [ { &quot;Id&quot;: &quot;...&quot;, &quot;Name&quot;: &quot;John Doe&quot; }, ... ]<br>  }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAd1bip2aUxqD9RPDBZ4aQ.png" /></figure><blockquote><strong><em>⚠️ Risks of Using </em></strong><strong><em>Map&lt;String, Object&gt;</em></strong></blockquote><p>While powerful, there are risks:</p><ol><li><strong>Loss of Compile‑time Safety</strong></li></ol><ul><li>Keys are just strings, no validation at compile time.</li><li>A typo in &quot;account&quot; breaks LWC silently.</li></ul><p><strong>2. Serialization Quirks</strong></p><ul><li>Complex types (like Datetime) come as strings in JSON.</li><li>Lists of SObjects serialize fully (may need trimming).</li></ul><p><strong>3. Maintainability</strong></p><ul><li>Wrapper classes provide strongly typed fields.</li><li>Maps require remembering key names.</li></ul><p><strong>4. Security Risks</strong></p><ul><li>Returning raw SObjects may expose fields unintentionally.</li><li>Use USER_MODE or pick only required fields.</li></ul><blockquote><strong><em>✅ Best Practices</em></strong></blockquote><p>Use <strong>wrapper classes</strong> for structured, long‑term APIs.<br>Use <strong>Map&lt;String, Object&gt;</strong> for:</p><ul><li>Quick, lightweight responses.</li><li>Proof of concepts or internal utilities.</li></ul><p><strong>Always</strong>:</p><ol><li>Standardize keys (message, response).</li><li>Sanitize sensitive data before returning.</li><li>Document expected keys in Apex comments.</li></ol><blockquote><strong><em>💡 Final Thoughts</em></strong></blockquote><p>Using Map&lt;String, Object&gt; to return multiple values from Apex to LWC is a <strong>simple yet powerful pattern</strong>.</p><p>By always including a <strong>message</strong> (success or error) and wrapping actual data inside <strong>response</strong>, you make your Apex ↔ LWC communication predictable, clean, and easy to maintain.</p><p>For small and flexible responses, this is a great alternative to wrapper classes — just keep in mind the risks and apply best practices.</p><p>🔥 Next time you need to send multiple values from Apex to LWC, try this pattern — it might save you a lot of boilerplate code!</p><p><strong>Happy Coding!</strong></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c752a206979f" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/returning-multiple-data-from-apex-to-lwc-using-map-in-single-call-to-server-c752a206979f">🚀 Returning Multiple data from Apex to LWC Using Maps in One call to Server</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Salesforce Metadata Auditing with SOQL: Objects, Fields & Permissions]]></title>
            <link>https://aws.plainenglish.io/salesforce-metadata-auditing-with-soql-objects-fields-permissions-da444b2a88e2?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/da444b2a88e2</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[audit]]></category>
            <category><![CDATA[sql]]></category>
            <category><![CDATA[soql]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sat, 26 Jul 2025 08:48:21 GMT</pubDate>
            <atom:updated>2025-08-18T16:40:51.909Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5RCh-IaMC1sgXDN8" /><figcaption>Photo by <a href="https://unsplash.com/@hishahadat?utm_source=medium&amp;utm_medium=referral">Shahadat Rahman</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>When working on security reviews or permission audits in Salesforce, it becomes critical to introspect metadata-level details like which profiles have access to which objects, fields, or system-level permissions. While Salesforce provides a UI for most of these settings, querying them directly using SOQL gives you speed, flexibility, and scalability.</p><p>In this article, I’ll walk you through a powerful set of <strong>SOQL queries</strong> to extract metadata information such as:</p><ul><li>All Objects &amp; Fields</li><li>Object/Field-level permissions by Profile or Permission Set</li><li>Who has specific system permissions like “Manage Apex”</li></ul><p>Let’s dive into it 👇</p><blockquote><strong><em>🧱 1. Get All Objects (Standard + Custom)</em></strong></blockquote><p>This SOQL query returns all objects in your org, both standard and custom. It’s useful for creating dynamic tools or running audits.</p><pre>SELECT QualifiedApiName, Label, KeyPrefix, IsQueryable, IsApexTriggerable<br>FROM EntityDefinition<br>ORDER BY QualifiedApiName</pre><ul><li>QualifiedApiName: API name of the object</li><li>KeyPrefix: Helps identify object via record IDs</li><li>IsQueryable: Can this object be queried via SOQL?</li><li>IsApexTriggerable: Can you write a trigger on this object?</li></ul><blockquote><strong><em>🧾 2. Get All Fields for a Specific Object</em></strong></blockquote><p>Want to know what fields exist on a given object like Account?</p><pre>SELECT EntityDefinition.QualifiedApiName, QualifiedApiName, Label, DataType<br>FROM FieldDefinition<br>WHERE EntityDefinition.QualifiedApiName = &#39;Account&#39;<br>ORDER BY QualifiedApiName</pre><ul><li>Replace &#39;Account&#39; with any object API name to get its fields.</li></ul><blockquote><strong><em>🔐 3. Profile-Based Object Access</em></strong></blockquote><p>This query shows the object-level CRUD permissions (Create, Read, Edit, Delete) granted to a particular profile.</p><pre>SELECT SObjectType, PermissionsRead, PermissionsCreate, PermissionsEdit, PermissionsDelete<br>FROM ObjectPermissions<br>WHERE Parent.Profile.Name = &#39;System Administrator&#39;</pre><p>You can replace &#39;System Administrator&#39; with any profile name.</p><blockquote><strong><em>🔎 4. Profile-Based Field Access</em></strong></blockquote><p>Field-level security is just as important as object-level permissions. Here’s how to see what field access a profile has:</p><pre>SELECT SObjectType, Field, PermissionsRead, PermissionsEdit<br>FROM FieldPermissions<br>WHERE Parent.Profile.Name = &#39;Standard User&#39;</pre><p>This gives read/edit permissions for all fields accessible to the <strong>Standard User</strong> profile.</p><blockquote><strong><em>🧩 5. Permission-Set Based Object Permission</em></strong></blockquote><p>If you’re auditing using permission sets instead of profiles, use this:</p><pre>SELECT SObjectType, PermissionsRead, PermissionsCreate, PermissionsEdit, PermissionsDelete<br>FROM ObjectPermissions<br>WHERE Parent.Name = &#39;Knowledge_Manager_171965&#39;</pre><p>Replace &#39;Knowledge_Manager_171965&#39; with the API name of the permission set.</p><blockquote><strong><em>🧬 6. Permission-Set Based Field-Level Permission</em></strong></blockquote><p>Similar to above, but for field-level access:</p><pre>SELECT SObjectType, Field, PermissionsRead, PermissionsEdit<br>FROM FieldPermissions<br>WHERE Parent.Name = &#39;Knowledge_Manager_171965&#39;</pre><p>This is useful for validating field-level security provided by permission sets.</p><blockquote><strong><em>🕵️‍♂️ 7. Permission Audit Example: Who Can “Manage Apex”?</em></strong></blockquote><p>Want to check who can write or deploy Apex code? Use this SOQL</p><pre>SELECT Assignee.Name, PermissionSet.Name, PermissionSet.PermissionsAuthorApex<br>FROM PermissionSetAssignment<br>WHERE PermissionSet.PermissionsAuthorApex = true</pre><p>This gives you a list of all users who have been granted the <strong>Author Apex</strong> permission via any assigned permission set.</p><blockquote><strong><em>💡 Final Thoughts</em></strong></blockquote><p>SOQL isn’t just for querying business data — it’s also a powerful tool for <strong>metadata introspection</strong>. With the right queries, you can:</p><p>✅ Perform quick audits<br>✅ Build admin dashboards<br>✅ Detect permission inconsistencies<br>✅ Automate documentation generation</p><p>🔐 If you’re handling security reviews, user access audits, or compliance requirements in Salesforce — keep these SOQL snippets in your toolkit.</p><p><strong>Happy Coding!!!</strong></p><h3>A message from our Founder</h3><p><strong>Hey, </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>Sunil</strong></a><strong> here.</strong> I wanted to take a moment to thank you for reading until the end and for being a part of this community.</p><p>Did you know that our team run these publications as a volunteer effort to over 3.5m monthly readers? <strong>We don’t receive any funding, we do this to support the community. ❤️</strong></p><p>If you want to show some love, please take a moment to <strong>follow me on </strong><a href="https://linkedin.com/in/sunilsandhu"><strong>LinkedIn</strong></a><strong>, </strong><a href="https://tiktok.com/@messyfounder"><strong>TikTok</strong></a>, <a href="https://instagram.com/sunilsandhu"><strong>Instagram</strong></a>. You can also subscribe to our <a href="https://newsletter.plainenglish.io/"><strong>weekly newsletter</strong></a>.</p><p>And before you go, don’t forget to <strong>clap</strong> and <strong>follow</strong> the writer️!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da444b2a88e2" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/salesforce-metadata-auditing-with-soql-objects-fields-permissions-da444b2a88e2">Salesforce Metadata Auditing with SOQL: Objects, Fields &amp; Permissions</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step By Step : Adding Razorpay Webhooks to Salesforce for real-time payment updates.]]></title>
            <link>https://medium.com/@amrit-suman/step-by-step-adding-razorpay-webhooks-to-salesforce-for-real-time-payment-updates-09acef6d2feb?source=rss-99747e2e36bf------2</link>
            <guid isPermaLink="false">https://medium.com/p/09acef6d2feb</guid>
            <category><![CDATA[salesforce]]></category>
            <category><![CDATA[payments]]></category>
            <category><![CDATA[salesforce-development]]></category>
            <category><![CDATA[webhooks]]></category>
            <category><![CDATA[integration]]></category>
            <dc:creator><![CDATA[Amrit Suman]]></dc:creator>
            <pubDate>Sun, 06 Jul 2025 06:02:49 GMT</pubDate>
            <atom:updated>2025-07-06T06:02:49.060Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Step By Step : Adding Razorpay Webhooks to Salesforce for real-time payment updates.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D73LRADG4lHbEHSBgqc6Cg.png" /></figure><p><strong><em>Required : A Salesforce Developer Edition Org, VS Code, Basic Knowledge of Salesforce and Razorpay account.</em></strong></p><p><strong><em>Disclaimer Note: Make sure you are in Test Mode in Razorpay as running in Live Mode will involve real money transactions on the go.</em></strong></p><blockquote><em>✨</em> <strong><em>Introduction</em></strong></blockquote><p>In my <a href="https://medium.com/@amritsuman1996/step-by-step-integrate-razorpay-with-salesforce-for-seamless-payments-for-your-customers-bd7927884254"><strong>previous article</strong></a>, we created a <strong>payment system</strong> where <strong>Salesforce </strong>generated <strong>Razorpay Orders </strong>and hosted a checkout page for customers to complete their transactions.</p><p>But what happens <strong><em>after</em> </strong>the payment?</p><p>Manually checking <strong>Razorpay </strong>for updates and then updating <strong>Salesforce </strong>records is <strong>inefficient</strong>. Instead, let’s make the process seamless:<br>✅ <strong>Automatically </strong>update your Salesforce Payment__c record to <strong>Paid</strong> when Razorpay <strong>confirms </strong>the payment.</p><p>This is where <strong>Razorpay Webhooks</strong> come in. In this guide, we’ll:</p><p>🛠️ Set up a webhook in Razorpay<br>🌐 Create a public REST API in Salesforce<br>🔁 Automatically update your payment record when a transaction succeeds<br>✅ Test the end-to-end flow in test mode</p><blockquote><strong><em>🪝 What is a Webhook?</em></strong></blockquote><p><strong><em>A webhook is like a “ping” from one system to another.</em></strong></p><p>Whenever something happens in <strong>Razorpay</strong> (like a successful payment), it sends an <strong>HTTP POST</strong> request to a <strong>URL</strong> you define. Salesforce can then act on this event automatically.</p><p>In our case, when a <strong>payment.captured</strong> event fires in Razorpay, Salesforce will:<br> ✔️ Find the matching Payment__c record<br> ✔️ Update its Status__c to <strong>Paid</strong></p><blockquote><strong><em>🔥 Step 1: Create a REST Endpoint in Salesforce</em></strong></blockquote><p>Expose a <strong>REST API endpoint</strong> in Salesforce using <strong>Apex</strong> so <strong>Razorpay</strong> can send webhook notifications.</p><pre>@RestResource(urlMapping=&#39;/razorpay/webhook&#39;)<br>global without sharing class RazorpayWebhook {<br>    @HttpPost<br>    global static void handleWebhook() {<br>        RestRequest req = RestContext.request;<br>        String body = req.requestBody.toString();<br><br>        // Safely parse to Map<br>        Map&lt;String, Object&gt; payloadMap = (Map&lt;String, Object&gt;) JSON.deserializeUntyped(body);<br><br>        // Extract nested fields step-by-step<br>        String event = (String) payloadMap.get(&#39;event&#39;);<br><br>        if (event == &#39;payment.captured&#39;) {<br>            Map&lt;String, Object&gt; payload = (Map&lt;String, Object&gt;) payloadMap.get(&#39;payload&#39;);<br>            Map&lt;String, Object&gt; paymentWrapper = (Map&lt;String, Object&gt;) payload.get(&#39;payment&#39;);<br>            Map&lt;String, Object&gt; paymentEntity = (Map&lt;String, Object&gt;) paymentWrapper.get(&#39;entity&#39;);<br><br>            // Extract fields safely from paymentEntity<br>            String razorpayOrderId = (String) paymentEntity.get(&#39;order_id&#39;);<br>            String razorpayPaymentId = (String) paymentEntity.get(&#39;id&#39;);<br>            String status = (String) paymentEntity.get(&#39;status&#39;);<br><br>            // Update existing Payment__c record based on Razorpay_ID__c<br>            List&lt;Payment__c&gt; payments = [<br>                SELECT Id, Status__c <br>                FROM Payment__c <br>                WHERE Razorpay_ID__c = :razorpayOrderId <br>                WITH SYSTEM_MODE<br>                LIMIT 1<br>            ];<br><br>            if (!payments.isEmpty()) {<br>                Payment__c p = payments[0];<br>                p.Status__c = &#39;Paid&#39;;<br>                update p;<br>            }<br>        }<br>    }<br>}</pre><blockquote><strong><em>🌐 Step 2: Make Your Endpoint Public</em></strong></blockquote><p>Since Razorpay is external, you need to expose your endpoint:</p><ol><li>Go to <strong>Setup → Sites</strong></li><li>Create a site (e.g., <strong><em>RazorpayWebhookSite</em></strong>)</li><li>Set a placeholder VF page as <strong>Active Site Home Page</strong></li><li>Assign guest user permissions to:</li></ol><ul><li>Access the RazorpayWebhook Apex class</li><li>Read &amp; update Payment__c object</li></ul><p>🛡️ <strong>Security Tip:</strong> For production, validate Razorpay’s signature using X-Razorpay-Signature header.</p><blockquote><strong><em>🔗 Step 3: Set Up Webhook in Razorpay Dashboard</em></strong></blockquote><ol><li>Login to <a href="https://dashboard.razorpay.com/">Razorpay Dashboard</a></li><li>Go to <strong>Settings → Webhooks</strong></li><li>Click <strong>Add New Webhook</strong></li><li>Enter the Salesforce site URL:</li></ol><ul><li>https://&lt;yoursite&gt;.force.com/services/apexrest/razorpay/webhook</li></ul><ol><li>Choose events to subscribe (start with payment.captured)</li><li>Set a <strong>Webhook Secret</strong> (you’ll use this for signature validation later)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NRfDEmJgovAhLogz4sgCOA.png" /></figure><blockquote><strong><em>✅ Step 4: Test the Webhook</em></strong></blockquote><ul><li>Switch Razorpay to <strong>test mode</strong></li><li>Make a dummy payment</li><li>After completion, <strong>Razorpay</strong> should call your <strong>Salesforce</strong> endpoint</li><li>Confirm that your Payment__c.Status__c is updated to <strong>Paid</strong> 🎉</li></ul><p><strong>That’s it !!!<br></strong>You have made a full payment system in your <strong>SFDC Razorpay Integration Project.</strong></p><blockquote><em>✅ </em><strong><em>Conclusion</em></strong></blockquote><ul><li>We created a <strong>Webhook </strong>in <strong>Razorpay </strong>to update the corresponding <strong>Order’s Payment </strong>status in <strong>Salesforce Payment </strong>Object.</li></ul><p>Some advanced best practices may be omitted for brevity.<br>Feel free to share observations or any issues in the comments.</p><p>👍 <strong>Like</strong> this post if it helped you!<br>💬 Drop your questions or observations in the comments.</p><p><strong>Happy Coding!!!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09acef6d2feb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>