2022 Developer Survey is open! Take survey.

Questions tagged [invocablevariable]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
2 answers
97 views

Flow InvocableAction returning an object with a list of objects

I'm looking to provide a Flow User with a list of Search Results based on a query. I have the following set of code, and haven't been able to figure out how to get it to work. (I've tried moving the ...
user avatar
0 votes
0 answers
41 views

External callout using Flow Builder - Apex Class Invocable Action

I would like to create a callout (webhook) when a custom field Batch_Name__c is updated which belongs to the Account Object. The purpose of this callout is to send all account information to an ...
user avatar
  • 1
0 votes
1 answer
121 views

How can I pass maps to an Invocable Method?

I have a method in my code that I want to make into an invocable method: // This should be an invocable method with @InvocableMethod private void updateContacts(Map<Id,Contact> newContactMap, ...
user avatar
  • 129
-3 votes
1 answer
26 views

I am not getting full code coverage in my test class, is it because test data isn't setup correctly?

I'm new to Apex and have been working on a class as a training excersize. The invocable method works as expected when called from a flow but I'm having trouble getting the proper code coverage. I ...
user avatar
  • 31
0 votes
1 answer
20 views

Can't Access 2nd Level in 'InvocableVariable' Object

I've got at flow that makes a callout and returns (to the flow) an object defined in apex (@InvocableVariable): public class MostOuter { @InvocableVariable public Inner1 var1; @InvocableVariable ...
user avatar
1 vote
1 answer
41 views

I need help resolving "unexpected token" error when setting up invocable variables in a test class

I have an invocable method with varables. I am stuck how to set these in a test class, below is the progress I've made. I am getting an errror "Unexpected token '='" on the last couple lines ...
user avatar
  • 31
0 votes
1 answer
238 views

How to set variable from flow to Apex and Call flow from Apex?

My flow type is autolaunched flow , the goal of the flow is to send Emails. I want to call this flow from Apex , besides i want to fill these fields : EmailAddresses and SenderAddress in Apex and ...
user avatar
  • 11
0 votes
0 answers
52 views

How do I access the Collection Values within a Flow that are the result of an Apex Action Output value?

Hi I've added an Apex Action element to my flow which includes an output value. The Apex Action only returns one record but I understand it has to be returned as a nested list. The output value is a ...
user avatar
0 votes
1 answer
46 views

Invocable variable set default value

Is it possible to set default value for invocable variable? Didnt find any info. @InvocableVariable(Label='Var' Required=true) public String var = 'var';
user avatar
0 votes
2 answers
57 views

Invocable Method + Variables -- Hitting Null Pointer Exception

I'm hitting a null pointer exception on an Invocable Method that I'm working on. I suspect that this is happening in the runClass method when I'm trying to convert my List of user ids ("userIds&...
user avatar
0 votes
1 answer
65 views

How to convert List<sObject> to List<InnerClass>

I have a @InvocableMethod that is used from Flow builder to create a record. Also I have a inner class with @invocableVariable. It is working fine, but I want to use the same method from another class ...
user avatar
  • 5
0 votes
0 answers
90 views

How to pass List<sObject> to @InvocableMethod that accepts only @InvocableVariable [duplicate]

I have a @InvocableMethod that is used from Flow builder to create a record. Also I have a inner class with @invocableVariable. It is working fine, but I want to use the same method to create records ...
user avatar
  • 5
0 votes
0 answers
188 views

"apexClass" is invalid. Provide the API name of an Apex class that includes an Apex data type supported in flows

We have created a unmanaged package to migrate to a new org. It builds the package successfully and it runs fine in the old org but when we go to install in the new org we get the following error: (...
user avatar
-1 votes
1 answer
224 views

Invocable method with wrapper parameter in console

I have invocable method and trying to pass wrapper as parameter. But i wanna run that in console. How can i do it? It gives me error wrong parameter when i am trying to pass Wrapper Object. public ...
user avatar
0 votes
2 answers
59 views

Get my output( from my apex class) and assign it to a flow variable

I have an apex class that returns a list of records/response as an output. public class KnowledgeArticleLookup { @InvocableMethod(label='Get Knowledge Articles' description='Gets knowledge article ...
user avatar
2 votes
1 answer
3k views

Passing variables from flow to apex and then from apex to flow

I'm trying to put in place a screen flow component in order to display knowledge articles based on the case fields and Knowledge-articles data category. In order to do so, I've created an apex class ...
user avatar
0 votes
1 answer
193 views

Pass values back to flow

I am brand new to Apex, this is my first attempt - I adapted some code from here which is working, but ideally, I'd like to pass the urlencoded variable back to the flow, however, I can't work out how ...
user avatar
  • 3
1 vote
1 answer
831 views

Invoke Apex to send email from Flow

We have a flow that stores the collection of Ids with Email address and we want to pass those Ids to send an email from Apex. I'm Trying to call the apex but it gives me error list has no rows. Couldn'...
user avatar
  • 55
1 vote
1 answer
95 views

How to use varaibles in apex soql query

I have a set of invocable variables in my below apex code and I'm hoping to replace the "Workflow_Step_Lookup__c" field that's in the SOQL statement with the "lookUpField" variable....
user avatar
  • 31
1 vote
2 answers
3k views

Passing an output variable from apex action back into flow

I'm using an apex action to obtain, from a recordId (which is the input variable that is sent from the flow into apex), the name of the object to which it belongs (objectname). I want to send this ...
user avatar
  • 125
0 votes
3 answers
698 views

Apex Error: You have uncommitted work pending. Please commit or rollback before calling out

I'm working with the DocuSign managed package and looking to allow invocable variable input from process builder. Below is the class I have created and it compiles fine but when I go to execute the ...
user avatar
  • 31
0 votes
1 answer
161 views

How to create invocable variables to be used in process builder (with DocuSign API)

Very new to the Apex developer game here and I'm having trouble figuring out how to create invocable variables that can be called from process builder. The use case here is we are using the docusign ...
user avatar
  • 31
1 vote
1 answer
672 views

InvocableMethod - returning string value back to the flow

I want to return a string value back to the flow. Got it this far, and also I am able to get the return value when I am not in an invocable method. Here is the error I am getting - Method does not ...
user avatar
  • 491
0 votes
1 answer
181 views

Get flow name in Invocable Method

is it possible to get a flow name that invoked the invocable method in Apex? Basically, I want to implement the getFlowName method that dynamically returns a flow name that invoked this method. @...
user avatar
  • 320
2 votes
1 answer
354 views

Einstein Bot - Passing boolean into Apex action

I need to pass boolean value (NOT asked to the customer) to apex action and need to hard code it. I have an invocable method which takes a list parameters like (psuedo code) public class SomeClass{ @...
user avatar
  • 163
0 votes
2 answers
1k views

Batch Apex vs Queueable

Thanks to another user (sfdcfox) I've got the following queueable apex being invoked via a screen flow that's being used to update account records. It's taking two string variables from the flow and ...
user avatar
1 vote
2 answers
661 views

Flow with invocable apex

Apex beginner here so I'm open to any and all suggestions. I'm working on a flow + invocable apex combination to mass reassign records. Basically trying to take variables obtained by the flow and ...
user avatar
0 votes
1 answer
342 views

@InvocableVariables in Apex test class

I am having difficulty writing tests for the apex class. This is my first time working with apex classes and I don't understand how to send to @InvocableVariable. I've read answers to similar ...
user avatar
2 votes
1 answer
2k views

how can I pass more than one parameter in invocable method without using flow

In my Process Builder, on creation of my custom Object Bank__c record, I want to pass two parameters(Ids, objectApIName) to InvocableMethod in Apex class, so I added this to my code, public static ...
user avatar
0 votes
1 answer
466 views

Iterate on a Flow Loop Element in an apex collection

I have an apex class that returns a list of a custom class with the following shape global without sharing class Result { @AuraEnabled @InvocableVariable global Id recordId; @AuraEnabled @...
user avatar
3 votes
0 answers
190 views

How can I make parent class variables Invocable in flow and process builder?

I have a scenario where I have an InvocableMethod which takes a custom Class with properties which are made available with the @InvocableVariable annotation, but I want this class to extend a parent ...
user avatar
1 vote
1 answer
82 views

Can't Return values in Apex from Flow Winter 19

I'm trying to refactor a flow I built in Spring 20, back to Winter 19. In Spring 20, I can just create a resource for my Apex Output. I've called this variable {!apexReturnedObj} I'm trying do some ...
user avatar
  • 1,268
0 votes
1 answer
273 views

Process Builder activation error

I have a process builder that invokes a method from a class where it passes one of the three parameters. In the class the InvocableVariable is a List of Custom object Call__c but from process builder ...
user avatar
  • 2,900
0 votes
1 answer
883 views

APEX Class Clean Up: Round Robin Lead Distribution Model

The code below is responsible for assigning Leads utilizing Round Robin distribution. The process is defined as follows: Lead is created and meets predefined criteria within a automated process (...
user avatar
1 vote
1 answer
853 views

How to set the variables of invocable method in unit test

I have an invocable method with varables. I am stuck how to set these in unittest Class public class or_service { public class invoceVars{ @InvocableVariable public id ...
user avatar
  • 2,068
3 votes
2 answers
4k views

Setting Invocable Variables in Test Class

I'm having difficulty finding the syntax to set my invocable variables in a test class related to the below code. I just put the relevant top part of the code in there. How can I set the ids to my ...
user avatar
2 votes
1 answer
631 views

Process Builder Action Type: Processes Requires SObject Variable

BACKGROUND I have two custom object which have a Master-Detail relationship: Credit Note Credit Note Line I have a Process on Credit Note which needs to invoke a Process on Credit Note Line But ...
user avatar
  • 8,223
3 votes
3 answers
2k views

How to have an InvocableVariable appear as Drop Down List in Process Builder

BACKGROUND I have a class with an InvocableMethod which takes a set of InvocableVariable's Such that I can call the Apex class from Process Builder. QUESTION I would like one of the fields to ...
user avatar
  • 8,223