Questions tagged [invocablevariable]
The invocablevariable tag has no usage guidance.
47
questions
0
votes
1
answer
42
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 ...
0
votes
1
answer
34
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 ...
1
vote
1
answer
109
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, ...
0
votes
1
answer
342
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;
@...
-2
votes
1
answer
222
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 ...
0
votes
1
answer
388
views
how can we access flows text Template's variable in apex code ? In body how can i access the variable of flow?
I have to post chatter through the flow as text template. When chatter is posted I need to set CreatedById as Customer_success_manager__c, so that I write apexcode, now how can I use that text ...
0
votes
1
answer
644
views
How do I write a test class for invocable variable
I have an invocable method with variables. I am stuck how to set these in unittest.
public class getBWS {
@InvocableMethod(label='Status' description='')
public static List<FlowOutputs&...
0
votes
1
answer
1k
views
Passing an variable from flow to @InvocableMethod
I am super close to getting this process to work, however, I am a little unclear as to how to deal with the @invocableVariable portion of the process. And just to preface... I am NOT a coder, like at ...
0
votes
1
answer
236
views
Variable does not exist: invocable method
I am trying to pass 2 ID's into an apex action from a flow that just query's a subset of ID's and passes it back to the flow. I'm getting the following error for both my invocable variables inside the ...
1
vote
2
answers
2k
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 ...
0
votes
1
answer
2k
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 ...
0
votes
1
answer
2k
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, ...
-3
votes
1
answer
30
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 ...
0
votes
1
answer
169
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 ...
1
vote
1
answer
360
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 ...
1
vote
1
answer
2k
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 ...
0
votes
0
answers
793
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 ...
1
vote
1
answer
657
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';
0
votes
2
answers
338
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&...
0
votes
1
answer
176
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 ...
0
votes
0
answers
93
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 ...
0
votes
0
answers
745
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:
(...
-1
votes
1
answer
1k
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 ...
0
votes
2
answers
2k
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 ...
4
votes
1
answer
11k
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 ...
0
votes
1
answer
2k
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 ...
1
vote
1
answer
3k
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'...
1
vote
1
answer
172
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....
1
vote
2
answers
13k
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 ...
0
votes
3
answers
4k
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 ...
0
votes
1
answer
276
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 ...
1
vote
1
answer
3k
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 ...
1
vote
1
answer
755
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.
@...
2
votes
1
answer
753
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{
@...
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 ...
1
vote
2
answers
1k
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 ...
0
votes
1
answer
673
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 ...
2
votes
1
answer
3k
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 ...
1
vote
1
answer
969
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 @...
5
votes
0
answers
259
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 ...
1
vote
1
answer
116
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 ...
0
votes
1
answer
312
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 ...
0
votes
1
answer
1k
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 (...
1
vote
1
answer
1k
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 ...
3
votes
2
answers
6k
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 ...
2
votes
1
answer
732
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 ...
4
votes
3
answers
3k
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 ...