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
0
votes
0answers
14 views

Deep Linking From Salesforce 1 App

I am using the Salesforce 1 iOS app and I want to embed a deep link in a custom button. This link must work offline (we utilize the SF1 Offline Caching capability) so I need to utilize the myapp:// ...
0
votes
2answers
20 views

Creating an invocable apex class sending email with optional send from

I am trying to set up an invocable apex class to send an email to a contact with merge fields from other record ID types with an optional variable to set the sender. I have looked at this question for ...
0
votes
2answers
40 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
2answers
62 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
1answer
32 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 ...
0
votes
0answers
10 views

Test Class for Invocable Class [duplicate]

Please help, had been trying but I always get 0% code coverage, I need a test class for the Invocable method below (Please note that the class is called being called from a flow which is triggered by ...
0
votes
1answer
45 views

How to use the force:navigateToURL from flow

I have a simple flow which i start with a button this has a screen component with a lightning component. I expect on clicking the button to be navigated to a record. To keep it simple I created a ...
0
votes
2answers
100 views

How to redirect to URL from flow with invocable apex

I have a flow from which I want to call a visualforcepage with some parameteres in the URL. The flow calls the invocable apex and the pagereference method but does not redirect to the url but does ...
0
votes
1answer
60 views

Packaged Lightning Flow Throws Error on Load When Apex Action is The First Element in The Flow

I run into a very bizarre issue when I packaged a lightning flow in a Managed Beta Package and try to tested out on the installed package. My lightning flow is linked to a quick action button and it ...
1
vote
1answer
192 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
2answers
29 views

How do I invoke an apexclass from flow and return a list back to flow

I have a flow from which I want to call an apexclass and retrieve a list of picklistvalues so a user can select from these in a flowscreen. How do I achieve this. I tried the code below but when I use ...
1
vote
1answer
105 views

Flow passing in record with picklist value into Invocable Apex method causes error

When I am trying to pass records prepared into an Invocable Apex method from a flow that have had picklist values set on the record I receive the following error message. An Apex error occurred: ...
1
vote
1answer
39 views

Class with Invocable method not visible in Profile.Apex Class Access

I am getting an error with a class. Normal error telling me to allow access for this new Profile - probably not put the class in the profile Class Access... But when I go to look, the class is not ...
1
vote
0answers
75 views

Apex Action not showing in Process Builder but does show up in Flow Builder

I have an Apex class containing an Invocable Method and no Invocable Variables that does not show up in Process Builder but does show up as an Action in Flow Builder. Normally this wouldn't be a ...
0
votes
1answer
45 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 @...
1
vote
0answers
31 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
1answer
47 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
1answer
125 views

Process Builder Setup does not load Apex class list

On my sandbox org this request failed when I try to select Apex as an action in Setup > Process Builder: /aura?r=8&ui-process-builder-components-controller-common.ApexTypesDataProvider....
4
votes
1answer
353 views

Can Process Builder run @future methods?

We're hitting CPU Time Limit Exceeded issues with a class that's being called by a Process Builder. From the SF solutions page, it was noted that one fix for CPU Time Limit Exceeded is to make the ...
1
vote
1answer
65 views

How to pass phone and email to invocable method

I have a visual flow from which I want to pass some person account info to an invocable method. It seems that when I use a phone and email field I can't assign them to my invocable class. Is this ...
2
votes
1answer
592 views

Invocable class error: List of size 127 too large to display

I have an Invocable class with the entry condition within Process Builder's process: OR( AND( ISNEW(), OR( ISPICKVAL([Case].Origin , "Website"), ISPICKVAL([Case]....
1
vote
1answer
37 views

@remoteAction living with @invocablemethod

I have built a class that calls a system external to Salesforce for checking customer's data. The service is an electronic VAT check provided by the state in the form of a very simple API. I want to ...
4
votes
1answer
89 views

Deprecate or remove an Apex Invocable Action from Process Builder in a Managed Package

We released global facing Invocable Apex Actions to be used by Process Builder, but would like to hide a couple of them from subscribing orgs. From the official documentation on invocable methods, ...
1
vote
1answer
21 views

How does a detail page button which is invoking a flow works?

I have a flow where I am passing a Custom Object's recordId to the flow by invoking it from a detail page button like this /flow/Activate_Record/myRecordId?={!Inactive_Farms__c.Id} This flow is ...
0
votes
1answer
210 views

How to avoid Apex CPU time limit exceeded error with Process Builder?

We have multiple rules setup for Case using process builder but one of the rule seems to be failing throwing CPU Time Limit Exceeded error. The process is failing at this step where i am updating ...
0
votes
0answers
188 views

How do I populate Salesforce records using REST API to collect data for updating

I'm new to working with API's and code in general, I have been challenged to create an invocable Apex class that calls a rest API to collect data to input into the Salesforce record that invoked the ...
0
votes
1answer
197 views

Visual Flow and Callout

I have a small problem with visual flow. I try to execute callout in flow through @InvocableMethod but before this callout, I do update a record(standard update action in Visual flow not in apex code(...
0
votes
0answers
22 views

For FSL : I'm Trying to create an invocable method that automatically populates the Service Territory of an account

I'm doing this by using an invocable method and a process builder. However, I have very little experience writing apex code I have been unable to successfully create one Apex class that actually does ...
0
votes
1answer
116 views

Einstein Bot apex causes 'close chat' message intermittently

I wrote a simple InvocableMethod to increment the amount of times an Einstein chatbot answers a users message. This works sometimes, very inconsistently. Sometimes it fails right away when I call a ...
0
votes
0answers
94 views

Flow screen component “Phone” field can not be assign to invocable variable

I have created flow and in this flow screen I have phone field. however, I cannot assign the value from this field to invocable variable. I do not see "Phone" in the dropdown list in invoacble ...
0
votes
1answer
87 views

Invocable Method in PB not firing

I am trying to call this invocable method via PB when the Demand_Gen_Owner OR the AccountOwner is changed. It doesn't fire and I cannot determine why. global class UpdateContactsFromAccount { @...
1
vote
0answers
136 views

Invocable method giving error in FSL flow mobile

I created a flow using Flow designer and it is a FSL mobile flow. Here I basically uploading a file and then using the same for Einstein Prediction and here is how I'm doing. Upload file using ...
2
votes
1answer
545 views

Using Invocable Apex in Flow Builder, can't save result?

I have a flow that will be used to convert a list view of selected records of unknown type to custom object records. When the flow launches from a list view page, there will be a screen element where ...
0
votes
1answer
84 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
1answer
299 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
1answer
632 views

Invocable Methods: How to return a collection of records to flow

This is my first time posting in StackExchange, and my first real attempt to put together some code. I am attempting to query CampaignMembers from the data base after passing a CampaignID to the ...
0
votes
0answers
122 views

Invocable Apex working when called from Process Builder but not Flow - what's wrong?

I have an invocable method that works just fine when I pass a Contact record Id to it via Process Builder. I'd like to use Flow to do this rather than PB, but get this error message: Error Occurred: ...
4
votes
1answer
2k views

How to pass in a list of Strings to an Apex Action in new Flow Builder?

I have a simple screen flow, which takes in a case Cancel Reason, and if that reason is Other, will get allow a user to specify the other reason via text entry. We have an Apex server method called ...
0
votes
1answer
60 views

Global invocablemethod for Professional edition org

Professional edition can have up to 5 process builders, but their immediate action doesn't contain "Apex". If we install a managed package which has a global invocable method, will the Apex appear as ...
1
vote
1answer
577 views

System.QueryException unexpected token

Trying to return all fields in object System.QueryException: unexpected token: '(' when I run the Invocable class at the parents = assignment public with sharing class AuditReportBulkifyClass { ...
0
votes
2answers
297 views

How to Redirect to /secur/logout.jsp from @Invocable method

I have a requirement where I want to logout of salesforce when certain statement inside an @invocable method is executed. For this purpose, I am trying to use PageReference to redirect to "/secur/...
3
votes
1answer
337 views

InvocableMethod Through anonymous APEX

I have an invocablemethod that runs from a process builder that got broken for a few months I had a mapping issue and some fields didn't populate or create for various reasons. In the process builder ...
2
votes
1answer
676 views

Flow Error - The number of results does not match the number of interviews that were executed

Calling Flow from Process Builder and getting error. The Flow has Invocable Apex solely to collect the "bulkified" records that Salesforce gathers, it was my understanding this is how we gathered them ...
0
votes
2answers
136 views

Method does not exist or incorrect signature invocable

Asked and answered here many times but I'm not finding this scenario. Getting method does not exist error when trying to invoke this Apex Class in my test. global with sharing class ...
4
votes
2answers
134 views

Standard invocable actions API: How to detect whether an input expects an array?

I'm working on some functionality that calls some standard invocable actions via Salesforce's REST API (https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/...
3
votes
1answer
255 views

Supply sObject record to process builder flow via REST API

I'm trying to invoke a custom flow (built via process builder) via REST API. The process begins with a contact record, This process starts when another process invokes it. Select an object to ...
1
vote
1answer
108 views

Resuming Flow after Invocable Future Method

Is there a way to resume a Flow after an @Future Apex method is completed? Right now I have an arbitrary Wait element but that's a hack workaround and not reliable of course. Cross posted in ...
2
votes
1answer
615 views

Platform Events + Process Builder + Apex with @future method

I'm running into an issue with too many future calls when handling Platform Events with a Process Builder that uses an invocable Apex class. Basic setup is 2 processes: The first publishes an event ...
1
vote
0answers
17 views

How to properly report an error from InvokableAction

I'm creating an InvokableAction that should be ran as a part of the flow. This action has two string inputs, but one of them must accept only one of the three specific values. As far as I know, I can'...
1
vote
0answers
443 views

How to pass multiple param in invocable method

from visual flow i am calling apex class, while calling I need to pass 5 param(3 List, 2 String).but it is not accepting more than 1 param @Invocalble method how to solve this public class SendMail { ...