Skip to main content

#Apex27 discussing

I have created an apex class with an @InvocableMethod and it works beautifully in my Sandbox, returning a single string converted from an actual return type of List<Response>. Now I need to create a test class and have only one problem remaining when calling the class. The line

List<Response> testGetHull = GW_SRO_Get_HullId.getIdFromString(new List<Request>{hullid});

gives the error: Method does not exist or incorrect signature: void getIdFromString(List<GW_SRO_Get_HullIdTest.Request>) from the type GW_SRO_Get_HullId 

hullid is populated with a single Request inputstring and the method returns List<Response> 

What could be wrong here? 

 

#Apex

0/9000

Hi Everyone,

I am trying to implement WhatsApp messaging through Salesforce Sales Engagement Cadences using WATI API integration, but I am facing issues with Cadence Step Flow execution and variable passing.

Current Architecture:

Contact Record Triggered Flow

→ Add Contact to Cadence

→ Cadence Step Flow

→ Apex Invocable Action

→ Queueable Apex

→ WATI API Callout

My goal:

When a contact reaches a cadence step, I want to automatically send a WhatsApp template message through WATI.

What I have implemented:

  1. Cadence Step Flow
  2. Apex Invocable Method
  3. Queueable Apex with Database.AllowsCallouts
  4. Named Credential for WATI
  5. Formula payload generation in Flow

Current Flow Payload:

959585****|||abd|||{"name":"Rakesh"}

Invocable Apex:

public with sharing class WatiWhatsAppService {

public class Request { @InvocableVariable(required=true) public String rawInput; } @InvocableMethod( label='Send WATI WhatsApp Message' description='Cadence-compatible WhatsApp action.' ) public static void sendWA(List<Request> requests) { List<String> rawInputs = new List<String>(); for(Request req : requests){ if(String.isNotBlank(req.rawInput)){ rawInputs.add(req.rawInput); } } System.enqueueJob(new WatiQueueable(rawInputs)); } 

}

Issue:

  • Cadence Step Flow is not executing automatically
  • Sometimes the flow step does not launch from cadence
  • Input variables like MobilePhone and FirstName were initially blank
  • I fixed variable mapping using input variables
  • Formula payload is now generating correctly
  • Apex action now appears in flow correctly
  • However, cadence screen flow execution itself is inconsistent

Questions:

  1. Does Cadence Step Flow require manual user interaction from Work Queue to execute?
  2. Is Cadence Step Flow suitable for backend API automation like WhatsApp sending?
  3. Has anyone successfully implemented automatic WhatsApp sending from Sales Cadence?
  4. Would Record Triggered Flow + Apex be a better architecture than Cadence Step Flow?
  5. Are there limitations with Invocable Apex inside Cadence Step Flow?

Any guidance or recommended architecture would be very helpful.

Thanks! 

#Salesforce Developer #Apex #Sales Cadences #Flow

3 comments
0/9000
Hi, As we all develop apex code in different sandboxes and finally need to move to QA sandbox/any other sandbox. What are the best tools available for code comparison (my current sandbox version against prod/any other sandbox version) before moving code from one sandbox to another to  understand the changes we did? What are the best practices for code comparison? Any ideas on this will be highly appreciated.
3 answers
  1. May 20, 8:42 AM

    VS Code + Git diff is probably the most common approach for Apex code comparison.

    For larger orgs or multiple sandboxes, teams also use org-to-org metadata comparison tools to compare:

    • Apex Classes
    • Triggers
    • Visualforce Pages
    • layouts and other metadata before deployment.

    We used to compare retrieved metadata manually, but recently started using BOFC for quicker sandbox vs production Apex comparisons:

    https://bofc.io/how-to-compare-apex-classes-across-multiple-salesforce-orgs/

    Best practice is definitely keeping Git as the source of truth and validating differences before every deployment. 

0/9000
PFB assignment details.

Create a class named 'Calculator'.

Declare 2 Integer variables num1 and num2, initialize with some random numbers.

Create a method named 'calculate'.

Declare 4 variables add, sub, mul and div inside the method to perform addition, subtraction, multiplication and division of num1 and num2 respectively.

Display the results of each calculation using 'System.debug' statements in log
3 answers
  1. May 16, 11:49 AM

    Salesforce community threads are always useful because someone has usually faced the exact same issue before, whether it’s permissions, Trailhead validation errors, or configuration problems. A lot of the troubleshooting process really comes down to having the right tools and clear formulas instead of guessing. That’s why simple utility platforms become so valuable over time. For students and fresh graduates, I’ve found GPA Converter Hub genuinely helpful for quick CGPA, SGPA, and percentage conversions without manually checking different university rules every time.

0/9000

Agentforce NOW AMA: Build with React and Salesforce Multi-Framework | May 27, 2026

 

Join the Salesforce Multi-Framework product team for a live AMA where we explore how to build production-ready apps with React. You'll see how to build dynamic apps that are connected to Salesforce data, secured by your org's existing permissions, and powered by the Agentforce 360 Platform.  

 

Our experts will walk you through the roadmap and answer your questions on: 

 

  • Developing with React: Build customer portals, employee-facing apps, and micro-frontends using React's expansive open-source ecosystem
  • Integrating with Agentforce Vibes: Go from natural-language prompt to working React app with Agentforce Vibes 2.0
  • Scaling on the Headless 360 Platform: Query records and invoke Apex from React with automatic authentication and access to the business logic, workflows, and compliance rules built into your org

Whether you're already building with React or just getting started, this is the session for you. 

 

Register and join us live: https://www.linkedin.com/events/7456009299094339585/

 

Can't make it live? All AMAs are recorded and available on demand on the Salesforce Developers YouTube channel

Agentforce NOW AMA: Build with React and Salesforce Multi-Framework | May 27, 2026 Join the Salesforce Multi-Framework product team for a live AMA where we explore how to build production-ready apps w 

#React Native #Open Source Tool #Prompts #Headless #Apex   

0/9000

I’m currently working on integrating AI features into a ticketing system for a client. The main focus areas are:

  • Summarizing support tickets automatically
  • Finding similar/repeated issues
  • Improving overall ticket analysis and resolution flow

I want to build this properly using Salesforce AI capabilities (Einstein / Agentforce / AI-related tools), but I’m a bit confused about which Trailhead trails/modules I should focus on first to get a solid understanding of AI in this context.

If anyone has experience with similar implementations or can recommend the best learning path/resources, I’d really appreciate the guidance. 

 

#Agentforce  #Salesforce Developer  #Artificial Intelliegnce  #Apex

3 comments
0/9000

public class AccountTriggerHandler {

public static void CreateAccounts(List<Account> accList) {

for(Account acc : accList) {

if(acc.ShippingState != acc.BillingState) {

acc.ShippingState = acc.BillingState;

}

}

}

}

Account Trigger

trigger AccountTrigger on Account (before insert) {

if(Trigger.isBefore && Trigger.isInsert) {

AccountTriggerHandler.CreateAccounts(Trigger.New);

}

}

AccountTriggerTest

@isTest

public class AccountTriggerTest {

@isTest static void createAccounts() {

List<Account> accList = new List<Account>();

for(Integer i=0;i<200;i++) {

Account acc = new Account();

acc.Name = 'Test Account '+i;

acc.First_Name__c = 'Acc FName '+i;

acc.Last_Name__c = 'Acc LName '+i;

acc.BillingState = 'CA';

accList.add(acc);

}

Test.startTest();

insert accList;

Test.stopTest();

List<Account> verifyAccList = [SELECT Id, ShippingState FROM Account];

for(Account acc : verifyAccList) {

System.assertEquals('CA', acc.ShippingState);

}

}

}

Hi All, I'm getting the following error - The 'AccountTrigger' trigger isn't working correctly. Make sure that the trigger inserts Account records with matching BillingState and ShippingState values, What could be the reason for this issue?

2 answers
  1. May 8, 12:40 AM

    Try deactivating all other account triggers! Specially if you are like me and use the same org for every challenge.

0/9000
I'm working on a lightning component for the service cloud utility bar which should essentially auto log you into Omni Channel once you have been logged into the service console.

In the lightning component controller, I have the following:

({

doInit: function(cmp, evt, hlp) {

window.setTimeout(

$A.getCallback(function() {

var omniAPI = cmp.find("omniToolkit");

omniAPI.setServicePresenceStatus({

statusId: "0N561000000027Y",

callback: function(result) {

if (result.success) {

console.log('Set status successful');

console.log('Current statusId is: ' + result.statusId);

console.log('Channel list attached to this status is: ' + result.channels);

} else {

console.log('Set status failed');

}

}

});

}), 100

)

//helper.setStatus(cmp, evt, hlp);

},

})

In my component I have:

<aura:component implements="flexipage:availableForAllPageTypes" access="global" >

<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

<lightning:omniToolkitAPI aura:id="omniToolkit" />

<!--

<lightning:utilityBarAPI aura:id="utilitybar" />

<lightning:button label="Get Status" onclick="{! c.getStatus }" />

<lightning:button label="Set Status" onclick="{! c.setStatus }" />

-->

</aura:component>

How do I go about getting this to load automatically? If I click on the lightning component, I will get signed into Omni-channel.  It would be ideal to have this happen on load.

 
3 answers
0/9000

Welcome to the Salesforce Developers Trailblazer Community — We Build What's Next 

 

Updated: April 2026

 

You're part of a global community of 30,000+ Salesforce developers — from those writing their first #Apex class to those architecting multi-agent systems. Whatever brought you here, you belong here.

 

Right now, the most exciting thing happening in our ecosystem is Agentic #AI  — and developers are at the centre of it. This post is your launchpad. 

 

🚀 Get Hands-On with #Agentforce 

The best way to understand agentic AI is to build with it: 

  • Register for upcoming Agentforce NOW events — AMAs, codeLives, and workshops where you learn directly from Salesforce experts and ship real code. 
  • Check out the new AgentExchange — a unified marketplace that brings together AppExchange, Slack Marketplace, and the Agentforce partner ecosystem.
  • The Salesforce Developer Edition just got a major upgrade — every org now includes Agentforce Vibes IDE, Agentforce Vibes with Claude Sonnet 4.5, and Salesforce-hosted MCP Servers. A complete AI-assisted development environment, free.

 

📦 Post-#TDX26 Repos Every Developer Should Bookmark

Fresh from TrailblazerDX 2026, these 3 open-source repositories are where the community is building right now:

  • Agent Script — The complete Agent Script language: parsing, linting, Language Server Protocol, UI — all open source. Dig in.
  • Agentforce Vibes Skills Library — A curated skills library optimised for building Apex, LWC, Agentforce and more. If you're building agents, start here.
  • Salesforce MCP Hosted Servers — Connect AI assistants like Claude and ChatGPT securely to your Salesforce logic and assets via hosted MCP servers.
  • Salesforce Multi-Framework Recipes Sample App — Code examples for building modern web apps on Salesforce using React with Salesforce Multi-Framework. Dig in.

📚 Level Up: Learning Paths for Every Stage

Whether you're deepening your platform fundamentals or going all-in on agentic AI:

🎙️ Stay Connected & Keep Learning

🌎 Find Your People

Have suggestions for resources or content? Drop them in the comments below — this community is built by all of us.

2 comments
  1. Apr 29, 1:23 PM

    Hi @Christie Fidura, I attended the "Agentforce NOW Agentforce Builder Workshop" event yesterday (excellent, BTW), but got logged out of my lab org before I could get my username.  I was just going to create a new lab org, but i need the Event Code for the event.  Can someone send to me.  Thx!

0/9000
I need help printing system.debug for my apex specialist class that I am working on. How do you recommend it?  Can I change the case to "closed" to test it? I am worried that it causes issues when I try to complete a challenge. I was not sure if those records should be touched or not. 

https://trailhead.salesforce.com/en/content/learn/superbadges/superbadge_apex 
2 answers
  1. Apr 27, 1:27 PM

    For Apex debugging, it’s better to rely on Debug Logs instead of changing record states like “Closed,” since that can affect validation rules or challenge requirements. Use System.debug() and check logs in the Developer Console or Setup → Debug Logs.

    Kind of like testing before final output—in printing I do the same by running a quick check from https://printertestingpage.com to avoid issues before the final result.  

0/9000