Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [invocable-method]

Invocable methods in Apex are called as invocable actions by the REST API and require the InvocableMethod annotation as an identifier. This can only be applied to one method in class and takes a maximum of 1 input parameter of a list of either a primitive data type, an sObject type or a user defined type.

Filter by
Sorted by
Tagged with
1 vote
1 answer
43 views

Incompatible data types between flow collection variable and invocable apex method's list parameter

I'm having an issue with a flow and an apex invocable action I want to add. this is my apex class: public without sharing class EnsayosRedPropiaConVentasCRMAction { @InvocableMethod(label = 'Validar ...
joacoiudica's user avatar
6 votes
0 answers
201 views

Allow Admin to safely customize UI and Logic of app via Flow

This is not a question about the general feasibility of a single aspect of my question. I know that and how they work. I am interested in real-world experience from AppExchange Partners on how to ...
Robert Sösemann's user avatar
0 votes
1 answer
63 views

Handling Mixed Object Types in Salesforce Invocable Methods within Record-Triggered Flows

I'm currently implementing an invocable method in Salesforce, which is intended to be called from a record-triggered flow. The method should be able to handle various types of objects, such as ...
Jasneet Dua's user avatar
1 vote
1 answer
92 views

Does it make sense to process List<InputVariables> in InvocableMethod?

As I see InvocableMethod always receives List. Now in my method I handle it like this: List<ReturnVariables> returnList for (InputVariables input : InputVariablesList) { ... returnList.add(.....
Max Vitko's user avatar
2 votes
0 answers
501 views

System.TypeException: "emailSimple" isn't a valid action type

I am trying to use an standard Invocable Action "Send Email" from my apex code with the following snippet: Invocable.Action action = Invocable.Action.createStandardAction('emailSimple'); ...
Gabriel Serrano Salas's user avatar
3 votes
1 answer
181 views

Accessing Flow Loop Variables in Custom Property Editors

I having been trying out Custom Property Editors for Flow as outlined here. For the most part, with some trial and error, I have gotten it to work, with one notable exception: In a Flow Loop, it now ...
BritishBoyinDC's user avatar
0 votes
1 answer
55 views

SOQL inside invocable method returns no results

I have an invocable method which is invoked when a platform event is published. So far the invocable method invokes on time and some elements of the data are extracted from the platform event. Now ...
sumchans's user avatar
  • 777
1 vote
1 answer
43 views

Invocable method parameter value is null

I am trying to run an scheduled flow which calls an invocable method. Every time the method is called the parameter is showing as null. Any idea what could be the reason? public static void ...
Prady's user avatar
  • 12.3k
0 votes
2 answers
48 views

Not sure if code is perfectly written for bulkification inside invocable method

I have been reading a lot of bulkifying code inside of the invocable methods both here at stack exchange and outside. More reading has led to a lot of confusion and still not sure if I have done it ...
sumchans's user avatar
  • 777
-1 votes
1 answer
113 views

Record Id sent from scheduled flow to Apex is coming as null in apex

The record sent sent from scheduled flow to Apex is coming as null. When I debug the flow, it is working fine and I could see record id.
Vinod Kumar's user avatar
0 votes
1 answer
54 views

Bulkify SOSL Invocable Apex

I have the following invocable class. It currently functions as I would like (updating the Interaction__c record with a ContactId that is found using a conditional SOSL query and subsequent regular ...
Anton's user avatar
  • 5
7 votes
1 answer
115 views

What are possible types to choose in the Invocable.Action.createCustomAction(type, name) method?

In the Winter '23 Release there was a new Apex class added - Invocable.Action One can invoke an action using, for instance, a createCustomAction(type, name) method. However, there are no possible ...
Przemysław Długoszewski-Tamoń's user avatar
0 votes
1 answer
61 views

Number of Results does not match the number of interviews

OK, I feel stupid. I've seen other questions from people who got this same error, but none of those scenarios was like mine. So I'm still really confused. My Flow is sending ONE PropertyId to an apex ...
april's user avatar
  • 1
0 votes
0 answers
324 views

. Can't perform callout when resuming a flow or inside an Apex Queueable

Currently, I've setup a scheduled flow to make an external callout. If i debug manually it's working successfully because it's firing for a single record. But if i scheduled the flow I'm getting below ...
Pavan tej's user avatar
  • 1,460
1 vote
1 answer
112 views

batch vs queueable for pseudobulkification of an app

I'm testing out an app that uses a callout to check some info in a government database and writes back any hits to a custom object. The app is designed to be used via an action on a record page, but I ...
gorav's user avatar
  • 4,537
1 vote
1 answer
176 views

New to apex "Error Occurred: The number of results does not match the number of interviews that were executed in a single bulk execution request

I am trying to return the email and id from a report inside of an apex flow using the following code. The flow sends 1 report id to the apex class. I keep getting back "Error Occurred: The number ...
val3ri3's user avatar
  • 15
1 vote
1 answer
262 views

Invocable Method to return External Service data type

Ideally, we will create an External Service based on the API Schema and use it in Flows. For some reason, when we do callouts in the Flow, the API cannot parse the Authorization header correctly, ...
codefish's user avatar
0 votes
1 answer
70 views

Invocable method icon not visible

I defined an invocable method with an SLDS icon like this: @InvocableMethod(Label='Clone Opportunity' IconName='slds:action:clone') Today I noticed that the SLDS icon is not displayed in the Flow ...
Semmel's user avatar
  • 2,497
0 votes
1 answer
173 views

How to name invocable classes? [closed]

By design, a class can only have one invocable method - which is very different from the way you could design classes containing web service methods (where you could have multiple exposed methods). ...
Semmel's user avatar
  • 2,497
1 vote
3 answers
1k views

How does bulkification work for records in an invocable action in a flow?

If I have an invocable method that is bulkified to handle multiple records updated in a single transaction, what is the most efficient way to write the Flow that calls it? My initial Flow design lets ...
AlwaysThinkin's user avatar
0 votes
2 answers
162 views

Managed package Flow actions in profession edition

I've a managed package that includes several flow actions(Invocable methods). In Enterprise edition, they're available in flow builder, however in professional edition they're not. I have confirmed in ...
vishesh's user avatar
  • 763
0 votes
0 answers
38 views

Why do annotation parameters not use a comma as separator?

Looking at the official documentation for the annotation InvocableMethod we can see that the parameters - unlike other languages I know - do not use a comma as a separator for the parameters. Any ...
Semmel's user avatar
  • 2,497
1 vote
1 answer
79 views

My LWC doesn't output the right format to be picked up in my Apex parser

I have a LWC which outputs a list of Line Items. Here is createInvoiceLineItems.html: <template> <lightning-card title="Invoice Line Items"> <template for:each={...
Luke Bray's user avatar
  • 506
2 votes
2 answers
1k views

Invocable Method - how do you return a value from an invocable with no input parameters?

Normally, with an invocable method, you'd do something to the effect of: public static List<Output> invoke(List<Input> inputs) { List<Output> outputs = new List<Output>(); ...
SarcasticSully's user avatar
0 votes
1 answer
148 views

Copy Field Values to a different Record Type

We need to keep an audit of all field changes for a Custom Object, Work Experience. I have created a separate child Object, Work Experience Audit, which has all of the same editable fields. I have ...
Jeff Callahan's user avatar
0 votes
1 answer
64 views

Flow Interview variables in invokable action

I've created an invocable apex action to be used in the flow builder. When the flow runs, is there a way for me to get the flow interview id in my invocable apex method? I don't want the user to pass ...
vishesh's user avatar
  • 763
1 vote
2 answers
1k views

Invocable Actions - Calling Flow from Apex with bulk data

I'm evaluating Mitch Spano's trigger framework that includes the ability to invoke Flows alongside Apex actions (with neat features for ordering, bypassing, etc). With record-triggered flows, you ...
Matthew Souther's user avatar
1 vote
0 answers
576 views

Filtered Knowledge Article Search in Einstein bot

I want to have a filtered search on the knowledge base using user's input in Einstein Bot. I understand there is an OOTB feature in Einstein bot to use Knowledge Object search wherein max of three ...
starhunter's user avatar
0 votes
1 answer
534 views

Flow action input doesn't recognize apex defined type

I've 2 flow actions Create Folder and Get Resource Property. Create Folder returns an apex defined type Resource. Get Resource Property expects a parameter of type Resource, however when I pass the ...
vishesh's user avatar
  • 763
-1 votes
2 answers
2k views

I want to pass collection variable to apex class

I want to pass the collection variable from flow to Apex which generates the PDF so, in collection variable, there are multiple records ,that I want to show in visual force page @InvocableMethod()...
TEJ's user avatar
  • 1
0 votes
1 answer
455 views

Apex class called from a flow wont give me the option to pass a collection of records

I have a flow setup to pass in a collection of opportunities to process and send back a collection of opportunities. In the flow I have queried the opps, assigned them to a record collection variable ...
Greg Watkins's user avatar
0 votes
1 answer
129 views

Write an invocable apex class to remove characters from a string

Fairly new to Apex so please bear with. I am trying to write a simple Apex Class that makes use of the replaceAll function to remove unnecessary characters from a string. I've got as far as the ...
Matt Stone's user avatar
0 votes
2 answers
1k views

Territory Assignments on Account page in Lightning mode

Currently in my org having Territory rules as follows, "Account: Account OwnerEQUALS User1" then Account will assign with "Abc" territory. When we change the Account Owner in ...
Vinay's user avatar
  • 7
0 votes
1 answer
162 views

Record Trigger Flow Running Apex Job - Avoid Flex Queue Limit

We are using a managed package, Geopointe, to define regions and Assign Leads based on Assignment Plans. The Business is insisting that "warm" Leads (based on the Lead Source) be assigned ...
Jeff Callahan's user avatar
0 votes
1 answer
856 views

Help bulkify salesforce invocable method (called from flow)

I have a very basic invocable action that is used by a flow to return the useraccess record if the user has edit rights (if not, the return would be a null list - barring sysadmin users of course). I ...
Ben's user avatar
  • 13
0 votes
0 answers
88 views

Storing state in invocableApex class - Flow Action

I have a record-triggered flow on the Accounts object. This flow invokes an Apex Action method called sayHello, which takes the name of a public group as its argument: public class MyClass { @...
user135792's user avatar
1 vote
1 answer
926 views

Use Invocable Apex Class with LWC

I have an Invocable Apex Method which I am using in a Flow and I want to call from my LWC. I have created a separate AuraEnabled Method to call the Invocable method. public with sharing class ...
Jeff Callahan's user avatar
0 votes
1 answer
407 views

Cannot get to the individual fields on an Apex defined collection variable inside of a flow

Continuig from the issue I posted just a few hours ago - Returning a list of lists to the flow returns error saying list out of bounds Here is my Apex action with the Invocable Method- public with ...
sumchans's user avatar
  • 777
1 vote
1 answer
608 views

Returning a list of lists to the flow returns error saying list out of bounds

I am returning a list of lists from Apex Invocable Method like below Here is my Apex defined class which I am using it later to create an Apex defined object inside of the flow. This class is in its ...
sumchans's user avatar
  • 777
0 votes
1 answer
457 views

How to parse list of custom Apex types returned from InvocableMethod in Flow

Given the following class with an @InvocableMethod: public class InvocableFileCountAction { public class FileCount { @InvocableVariable public Id recordId; @...
Thomas Taylor's user avatar
0 votes
0 answers
119 views

How to test @Invocable SendEmail method

I have a flow that calls an invocable method that sends emails. My class : public class SendVerificationEmailAction { @InvocableMethod(label='Send Verification Email' category='Email' description='...
Hajar BL's user avatar
-2 votes
1 answer
528 views

I have a simple class that grabs the last two digits of the current year. I need to make this class Invocable, how do I do this?

I need to just make this class an Invocable method so that I can grab the last two digits of the year from this class and add it to a text field on another object using a flow. This is the code from ...
Zzz's user avatar
  • 13
2 votes
1 answer
1k views

What's the best practice when creating multiple @InvocableMethods that can be used in a flow?

I would like to know if there are any best practices when building multiple @InvocableMethods for a Salesforce flow. As of now, Salesforce limits only 1 @InvocableMethod per apex class. Only one ...
apz's user avatar
  • 427
0 votes
1 answer
127 views

How to bulkify invocable method that receives a list of leads

@InvocableMethod(label='lead Round Robin' description='Round robin lead assignment' category='Lead') public static void AssignLeads(List<ID> ids) { Lead l = [Select Id, ...
Trace's user avatar
  • 127
1 vote
1 answer
85 views

Help with basic Apex

Hello trying to branch out of my basic Admin duties to learn a bit more on Apex. I am looking to create an Invocable Apex class that updates a User based on a list of Users being passed to it from a ...
Cory Iler's user avatar
0 votes
1 answer
635 views

Permission issues with apex classes

We have few apex classes which has @InvocableMethod and are used inside screen flows on production. These apex classes is not given access in profile/permission set. We have custom profile 'Platform ...
Jason Rickert's user avatar
1 vote
1 answer
499 views

How do we know in apex whether the context is executed from Flow asynchronous

I have a scenario where I'm inserting a record in future, and there is a flow automation on that object. The flow has an async path which is invoking an apex action. How do I know within that that ...
Manjunatha V P's user avatar
1 vote
2 answers
2k views

How can I find where an @InvocableMethod is used?

Given a class with an @InvocableMethod, how can I determine where the InvocableMethod is actually being used? Apex Classes don't have a "Where is this used?" button, only a "Show ...
Jason Clark's user avatar
  • 11.9k
0 votes
2 answers
96 views

Deduplicate list in Apex? (ApexAction for Flow)

I am competent with Salesforce but far less so with Apex! Due to flow limitations I am trying to do something with an Apex Action. I pass to the code below a TASKID. In turn this code finds other ...
Ben's user avatar
  • 13
0 votes
1 answer
754 views

Display List<String> from Apex class to Flow Screen Component [duplicate]

I have written a code which performs one particular automation. My objective is to display the output of type List string in the screen component of flow. When I try to create a new single record ...
sourav guha's user avatar

1
2 3 4 5 6