You need to sign in to do that
Don't have an account?
Stefaan Somers 11
Help Needed: Resolving APEX CPU Timeout in Lightning Flow with HTTP Callout - Unable to call ExternalService from callout in APEX class
Hi Salesforce Community,
I'm working on a lightning flow that's scheduled to run and perform specific tasks. The flow's main objective is to retrieve records with a certain status and loop through these records to make an HTTP callout.
Here's a brief overview of the process:
I'm consistently hitting an APEX CPU timeout limit. To address this, I've considered creating a platform event where I can publish an event with the JSON value of the 'body' variable. However, this isn't directly feasible in the flow, leading me to consider developing an invocable Apex class.
Here's the draft of the class I'm contemplating:
Challenge:
I'm unable to locate the class ExternalService__SendReminder_SendReminders_IN_body in the IDE, which Salesforce generates. However, it is visible in the Dynamic class of Apex classes overview in Setup.
I'd greatly appreciate any insights or advice on the following:
Thanks in advance for your assistance!
I'm working on a lightning flow that's scheduled to run and perform specific tasks. The flow's main objective is to retrieve records with a certain status and loop through these records to make an HTTP callout.
Here's a brief overview of the process:
- The flow assigns values to a custom instance 'body' of the type ExternalService apex class ExternalService__SendReminder_SendReminders_IN_body which is generated by Salesforce.
- The primary task is to make an HTTP callout using these values.
I'm consistently hitting an APEX CPU timeout limit. To address this, I've considered creating a platform event where I can publish an event with the JSON value of the 'body' variable. However, this isn't directly feasible in the flow, leading me to consider developing an invocable Apex class.
Here's the draft of the class I'm contemplating:
public class JsonUtility { public class RequestWrapper { @InvocableVariable public ExternalService.xxxx myVariable; } @InvocableMethod public static List<String> serializeToJson(List<RequestWrapper> requests) { List<String> jsonStrings = new List<String>(); for (RequestWrapper req : requests) { jsonStrings.add(JSON.serialize(req.myVariable)); } return jsonStrings; } }
Challenge:
I'm unable to locate the class ExternalService__SendReminder_SendReminders_IN_body in the IDE, which Salesforce generates. However, it is visible in the Dynamic class of Apex classes overview in Setup.
I'd greatly appreciate any insights or advice on the following:
- How to effectively resolve the APEX CPU timeout issue in this scenario?
- Why the generated class is not visible in the IDE and how to access it for development purposes?
Thanks in advance for your assistance!