Skip to main content Join us at TDX in San Francisco or on Salesforce+ on March 5-6 for the Developer Conference for the AI Agent Era. Register now.
Featured group

* Salesforce Developers *

Welcome! Here, you can collaborate, network, build connections, learn Salesforce development, and grow. Be sure to check out the great list of resources in the right navigation pane to help you learn, earn and connect!
Pinned

New to Developing with Salesforce? Check out These Resources!

 

*Updated: 2 October 2024

 

Welcome - we are so glad you're here. These resources will help you get an understanding of why you might want to become a Salesforce developer, what type of development you'd like to focus on, and great ways to connect and build your network. 

 

If you're a Java developer (welcome!), here are some specific resources for you: 

New to Developing with Salesforce? Check out These Resources! *Updated: 2 October 2024 Welcome - we are so glad you're here.

Have suggestions for future types of content? Let us know in the comments below!

0/9000
1 comment
0/9000

Say hello to Salesforce Lightning Design System 2 (Beta), the foundation of our agentic design system! 🎉 Bring your brand to life with increased styling flexibility, built-in accessibility, and the new Salesforce Cosmos theme. Activate and explore the Salesforce Cosmos theme in your sandbox and post your SLDS 2 (beta) questions in the @Design Trailblazers community.  

 

What’s new in SLDS 2? 📣

  • Admin Trailblazers: Empower users with Salesforce Cosmos, the new UI theme built on SLDS 2, for intuitive navigation and streamlined task completion.
  • Developer Trailblazers: Develop future-proofed code with enhanced styling hooks and use the latest developer tools to analyze and upgrade your styling API.
  • Designer Trailblazers: Quickly apply new color values and draw from an enriched color palette in Themes and Branding to unleash your creativity.

 

Ready to go? 🏁 We’ve got you covered! Get started with the SLDS 2 Transition Guide

 

Have you heard? 👀 The transition to SLDS 2 unlocks Dark Mode - coming to the Cosmos theme in Summer ‘25! Be sure to bookmark the SLDS 2 website and join @Design Trailblazers

 to stay up to date on what’s possible with SLDS 2.  Say hello to Salesforce Lightning Design System 2 (Beta), the foundation of our agentic design system! 🎉 Bring your brand to life with increased styling flexibility, built-in accessibility, and the n

 

CC: 

@* Release Readiness Trailblazers *; @Admin Trailblazers; @* Salesforce Developers *

5 comments
  1. Mar 3, 9:30 PM

    @Shannon Harrop (Salesforce UX Enablement)

    I checked with some other folks in my company-- it looks like the option is available on the fullsand box for our main instance, but not in the developer one I spun up.  

     

    I checked the info for my instance according to the instructions on the SF website; it

    says

    I'm on Spring '25, but I don't see anything for SLDS2 in my options. 

     

    Developer Edition 

      |   | Instance | USA840

0/9000

Details: 

  • Issue: When running an evaluation on my third-party library’s source code, the Locker Console sometimes returns true and other times returns undefined, even when the Locker toggle is enabled
  • Steps to Reproduce: 
    1. Open Locker Console Tool in Developer Console. 
    2. Load the third-party library and attempt to evaluate its source code. 
    3. Observe that the returned result fluctuates between true and undefined, making it unclear whether the library is restricted or allowed. 
  • Expected vs. Actual Behaviour: 
    • Expected: A consistent evaluation result with a clear definition of what true and undefined mean. 
    • Actual: The evaluation result varies, leading to confusion regarding whether the third-party library is compliant with Locker Service security restrictions

Questions: 

  1. What does "true" vs. "undefined" mean in the Locker Console evaluation results? 
  2. Why does the result fluctuate when Locker is enabled? 
  3. Is there a documented definition for these evaluation results to validate third-party libraries correctly? 
  4. Where can I find deeper technical details beyond standard documentation?  

I referred this documentation, but I didn't get exact clarification about this. 

https://developer.salesforce.com/docs/platform/lightning-components-security/guide/locker-console-evaluate.html

 

  

 

I am evaluating a third-party library using the Locker Console Tool in Salesforce to check for potential security concerns. However, I observed inconsistent results during the evaluation process.

0/9000

I have an Apex class that generates PDF and after a record created and attach that PDF under Notes and Attachments for that record and sends an email to the email field from the record and attach that PDF in the email also. This is working fine when I manually create a record within salesforce. But it is not happening when the record creating through a record triggered flow. what could be the solution. below is my Apex  Class Code from Production: 

******************************************************************************8 

 

public class ContractPDFEmailSender {    @InvocableMethod    public static void sendContractEmail(List<Id> contractIds) {        for (Id contractId : contractIds) {            List<Contract__c> contractList = [SELECT First_Name__c, Last_Name__c, Email__c FROM Contract__c WHERE Id = :contractId LIMIT 1];            if (contractList.isEmpty()) {                System.debug('No Contract record found for ID: ' + contractId);                continue;            }            Contract__c contract = contractList[0];            if (contract.Email__c == null) {                System.debug('No email found for this contract.');                continue;            }            // ✅ Fix: Mock the PDF content for test execution            Blob pdfBlob;            if (Test.isRunningTest()) {                pdfBlob = Blob.valueOf('Mock PDF Content');  // Return dummy content in test mode            } else {                PageReference pdfPage = Page.ContractPDF;                pdfPage.getParameters().put('id', contractId);                pdfBlob = pdfPage.getContent();  // Normal execution            }            String fileName = 'Contract_' + contract.First_Name__c + '_' + contract.Last_Name__c + '.pdf';            // Save as ContentVersion            ContentVersion contentVersion = new ContentVersion();            contentVersion.Title = 'Contract_Details.pdf';            contentVersion.PathOnClient = 'Contract_Details.pdf';            contentVersion.VersionData = pdfBlob;            contentVersion.FirstPublishLocationId = contractId;            insert contentVersion;            // Create Email Attachment            Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment();            attachment.setFilename(fileName);            attachment.setBody(pdfBlob);            attachment.setContentType('application/pdf');            // Send Email            Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();            email.setToAddresses(new List<String>{contract.Email__c});            email.setSubject('Your Contract PDF');            email.setPlainTextBody('Dear ' + contract.First_Name__c + ',\n\nAttached is your contract PDF.\n\nRegards,\nYour Company');            email.setFileAttachments(new List<Messaging.EmailFileAttachment>{attachment});            // Send email            Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email});        }    }}

 

#Salesforce Developer @* Salesforce Developers *

1 answer
  1. Mar 3, 4:38 PM

    Hi @Nargees Mahammad

     

     

    Make sure that your flow is correctly set up to invoke the ContractPDFEmailSender class. Verify that the flow is passing the correct record IDs to the sendContractEmail method.  

     

    Try this once 

     

    public class ContractPDFEmailSender {

    @InvocableMethod

    public static void sendContractEmail(List<Id> contractIds) {

    for (Id contractId : contractIds) {

    List<Contract__c> contractList = [SELECT First_Name__c, Last_Name__c, Email__c FROM Contract__c WHERE Id = :contractId LIMIT 1];

    if (contractList.isEmpty()) {

    System.debug('No Contract record found for ID: ' + contractId);

    continue;

    }

    Contract__c contract = contractList[0];

    if (contract.Email__c == null) {

    System.debug('No email found for this contract.');

    continue;

    }

    // ✅ Fix: Mock the PDF content for test execution

    Blob pdfBlob;

    if (Test.isRunningTest()) {

    pdfBlob = Blob.valueOf('Mock PDF Content'); // Return dummy content in test mode

    } else {

    PageReference pdfPage = Page.ContractPDF;

    pdfPage.getParameters().put('id', contractId);

    pdfBlob = pdfPage.getContent(); // Normal execution

    }

    String fileName = 'Contract_' + contract.First_Name__c + '_' + contract.Last_Name__c + '.pdf';

    // Save as ContentVersion

    ContentVersion contentVersion = new ContentVersion();

    contentVersion.Title = 'Contract_Details.pdf';

    contentVersion.PathOnClient = 'Contract_Details.pdf';

    contentVersion.VersionData = pdfBlob;

    contentVersion.FirstPublishLocationId = contractId;

    insert contentVersion;

    // Create Email Attachment

    Messaging.EmailFileAttachment attachment = new Messaging.EmailFileAttachment();

    attachment.setFilename(fileName);

    attachment.setBody(pdfBlob);

    attachment.setContentType('application/pdf');

    // Send Email

    Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();

    email.setToAddresses(new List<String>{contract.Email__c});

    email.setSubject('Your Contract PDF');

    email.setPlainTextBody('Dear ' + contract.First_Name__c + ',\n\nAttached is your contract PDF.\n\nRegards,\nYour Company');

    email.setFileAttachments(new List<Messaging.EmailFileAttachment>{attachment});

    // Send email

    Messaging.sendEmail(new List<Messaging.SingleEmailMessage>{email});

    }

    }

    }

    Thanks

0/9000

currently using this img from Static resource <apex:image id="logo-image" value="{!$Label.Boost_Portal_Login_URL  + RIGHT($Resource.NUR_Logo, (LEN($Resource.NUR_Logo) - 1))}" alt=" Logo"/>   

 

@* Salesforce Developers * 

1 answer
0/9000

My system is integrated through the "Notta" application in Connected Apps. Salesforce users can authorize their Salesforce accounts in my system, and my system can use the users' credentials to create records in the users' Salesforce accounts. Now, I want to ensure that after a user successfully authorizes my system, any changes they make to a contact in Salesforce trigger a notification to my system without requiring the user to perform any additional actions—just the initial authorization is needed. How can I achieve this? This should be similar to HubSpot’s app webhooks.     

 

@* Salesforce Developers * 

1 answer
0/9000

Hi All, 

 

I am having issues with an external Service, to use an Http Callout in Flow. My HTTP Callout POST data from my Flow to another service and provide a response, I have used example payload/response as the payload can result in different response data based on the inputted values so I am trying to capture everything. my input is a basic JSON with sting values and my response body is an array. 

 

Payload Example: 

  "system": "System", 

  "webMethod": "NewEnquiry", 

  "CaseType": "reporting", 

  "reference": "F1234567789" 

 

My example Response is: 

 

 { 

 "json_featuretype" : "call_return", 

 "system" : "System", 

 "webMethod" : "New, 

 "EnquiryNumber" : "0986543", 

 "LoggedTime" : "2025-03-03T13:54:12", 

 "EnquiryLogTime" : "2025-03-03T13:54:12", 

 "LoggedByUserName" : "CRM CRM", 

 "LoggedByUserId" : "CRM" 

 } 

 ] 

 

I need to setup so I can provide an example payload and the call will result in different responses based on the payload body. So setting up I also provided an example response body with all possible fields. When testing I am getting a 200 code and confirming that the payload has gone where it needs to but my Response is null? 

 

Thanks 

 

@* Salesforce Developers *

 

 

#Flow  #Data Management  #Salesforce Developer  #HTTP Callouts  #External Service

1 answer
  1. Mar 3, 3:35 PM

    Per my own experiences, SF not necessarily response immediately. In many cases, it takes time or just swallows actual responses, and you will end up with something that is not in the documentation. 

    One "mitigation" tactic is to make another request and search for your data. 

    There is a postman collection on the net (half-official) where you can find exact examples (most of them working, actually) and some example responses, etc.

0/9000

String query =  'SELECT MetadataComponentName, MetadataComponentType, RefMetadataComponentName, RefMetadataComponentType ' +                               'FROM MetadataComponentDependency '+                             'WHERE RefMetadataComponentId=\'' + sObjectNames[0].sObjectName + '\'';                       HttpRequest req = new HttpRequest();            req.setEndpoint('callout:namedCred' + '/services/data/v63.0/tooling/query/?q=' +  EncodingUtil.urlEncode(query,'UTF-8'));            req.setMethod('GET');             req.setHeader('Content-Type', 'application/json');                      Http http = new Http();            HttpResponse res = http.send(req);                       if (res.getStatusCode() == 302) {                String redirectUrl = res.getHeader('Location');                if (redirectUrl != null) {                    HttpRequest newReq = new HttpRequest();                    newReq.setEndpoint(redirectUrl);                    System.debug(redirectUrl);                  newReq.setMethod('GET');                    newReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());                    newReq.setHeader('Content-Type', 'application/json');       the first http request gets authenticated by named credentials, the second calls the redirect url, how can i authenticate it?   newReq.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());   does not work, gives Unauthorized error  

 

@* Salesforce Developers *

2 answers
0/9000

Is it possible to create a trigger and an Apex class that works before inserting a record into a custom object (Object A) with an encrypted field storing the Aadhar number? There is another object (Object B - Blacklisted Aadhar) where I store blacklisted Aadhar numbers.     I want to create an Apex class for Object A that checks if the Aadhar number exists in Object B (blacklisted Aadhar). If it matches, I don't want to save the record and need to throw an error. However, I would like to update fields in Object B, such as the number and email used to create the record in Object A, without saving a new record.    (I tried both the @future method and .addError(), but neither of them worked. I'm not sure if it's even possible because .addError() stops the data from being saved in the database, and I'm trying to update existing records in Object B. Since I wasn't sure, I just wanted to get others' opinions.)   

@* Salesforce Developers * 

0/9000

How to cover the test class for below method including the map and insertion of Permission Set     

 

Public void assignPersonlizePermSet(List<Id> userId){ 

        List<PermissionSet> idPermissions = [Select Id from PermissionSet where Label =: 'WM View Personalize']; 

        Map<Id, Set<Id>> mapExistAssignment = new Map<Id, Set<Id>>();  

        for(PermissionSetAssignment objCS : [select PermissionSetId, AssigneeId from PermissionSetAssignment where AssigneeId  in : userId]){ 

            if(!mapExistAssignment.containsKey(objCS.AssigneeId)){ 

                mapExistAssignment.put(objCS.AssigneeId,new set<Id>{objCS.PermissionSetId}); 

            } 

            else { 

                mapExistAssignment.get(objCS.AssigneeId).add(objCS.PermissionSetId); 

            } 

        } 

        List<PermissionSetAssignment> lstPermSetAssign = new List<PermissionSetAssignment>(); 

 

        for(Id idUser : userId){ 

            for(PermissionSet idPermission : idPermissions){ 

                if(!mapExistAssignment.get(idUser).contains(

idPermission.id

)){ 

                    PermissionSetAssignment permSetAssign = new PermissionSetAssignment(); 

                    permSetAssign.PermissionSetId =

idPermission.id

                    permSetAssign.AssigneeId = idUser; 

                    lstPermSetAssign.add(permSetAssign); 

                }                     

            } 

        } 

        if(lstPermSetAssign.size()>0){ 

        insert lstPermSetAssign; 

        }   

 

    }

@* Salesforce Developers *

  

 

#Salesforce Developer

0/9000