9
votes
Accepted
Alternatives for handling a Long Running Transaction
That's tricky. The first thing that comes to mind is to do it asynchronously and find a way to "subscribe" to the response. You can make use of Platform Events for this.
Call your Apex class and ...
9
votes
Continuation Object from Trigger
You don't need to do either. Simply make a Queueable action that you call from the trigger to perform your callouts:
trigger XYZ on ABC (after insert, after update) {
System.enqueueJob(new ...
6
votes
@future method vs Async callout
The Async class is intended to be used in a continuation. See Make Long-Running Callouts from a Visualforce Page
Basically, a continuation will provide a callback mechanism so that when the async ...
5
votes
Accepted
Continuation: Constructor not defined
Based on the code you've posted, it seems that you have a class named Continuation. You should rename the class so it does not conflict with the built-in class. Alternatively, you can fix it locally ...
5
votes
Accepted
Lightning components and Continuations
After working with Salesforce on this I got interim workaround until continuations are supported by Lightning framework.
Create a Visualforce page what will be performing callouts using continuations ...
4
votes
Accepted
Code Duplication when using Continuation Framework
Only the code for creating the Continuation and the callback handler need to be in the controller. The code to create the HttpRequest and then handle the HttpResponse can still be in your utility ...
3
votes
Accepted
Continuation not working for the endpoint which has Curly braces in it
That isn't a valid URL. Curly braces need to be percent-encoded when they appear in a URL, as other invalid and/or "unwise" characters as defined by the RFC. See When, if ever, should characters like {...
3
votes
Continuation Error: StatusCode=400
I think as of now certificate based authentication is not supported in Continuation.
Ref : https://www.youtube.com/watch?v=vgQe0iokHUM&feature=youtu.be&t=1926
2
votes
Accepted
Asynchronous Callouts/Continuations in Embedded Visualforce
There is a known issue when you use Continuation with Visualforce pages re-render action. I am not very sure it is related to it but seems like you have found another way of same problem. Eventually ...
2
votes
Accepted
Making an Asynchronous Callout from another class
Generally speaking, a Continuation requires a Visualforce page. There was a work around presented by Reggie Nair in his Dreamforce 2015 Session - Introduction To Apex Asynchronous Callout Framework, ...
2
votes
Accepted
Using Continuation without Visualforce
If you are running into limits on the number of callouts you can make in a scheduled job, the solution to execute a batch job and set the batch size to 100 (or some smaller number if you make more ...
2
votes
DML operations in the Apex callback method
I found a working solution for doing DML from a continuation method. According to the documentation for Continuation Limits,
An Apex method that returns a Continuation object can’t perform Data ...
2
votes
How to create controller class instance to pass it as argument of 'Test.invokeContinuationMethod' while Callback method is Static
I think this is a gap in the testing framework for continuations. The problem is not that your method is static, but that the callback method does not match the method signature expected by Salesforce,...
2
votes
LWC Continuation Issue: Apex methods for continuation can not be invoked from a non-continuation action
The issue was in lwc import.
import getTotalNetPriceFromSAP from '@salesforce/apex/SFMS_SubscriptionsOverviewController.getTotalNetPriceFromSAP';
But for Continuation it must be:
import ...
2
votes
Accepted
Apex Continuation method that call service method
LWC import must get Apex method from apexCountinuation but not apex resource.
'@salesforce/apexContinuation/ApexClass.ClassMethod';
not
'@salesforce/apex/ApexClass.ClassMethod';
2
votes
Continuous integration using REST api in vf page
A Continuation has nothing to do with continuous integration.
From the perspective of the on-platform developer, the response data is stored in the Continuation object, and is accessed via ...
1
vote
Accepted
Apex Continuation execution failed and did not start - LWC
Seems like the issue was with the Remote Site settings where I had to include the endpoint as: https://myRESTapiURL.com:11305 to make API callout successful, instead of https://myRESTapiURL.com. I ...
1
vote
Callout not happening from Continuations class(LWC)
There is no triggering point for findContacts in your code.
You should call that from connectedCallback, if you want the callout to happen right after component loads.
connectedCallback() {
this....
1
vote
Resume logic after long-running service sends Platform event
There's no single feature that is responsive to all of these functional needs. You'll need to do some work, possibly quite a bit of work, both to build this overall process orchestration and to make ...
1
vote
Callback method is not getting called in continuation object
As you are declaring endpoint directly in class String endPoint = 'callout:SFDC_SRC/services/apexrest/v1/getAccounts/';, you are getting invalid session Id error. Refer to this document: (Holds true ...
1
vote
not able to access the variable values after using the continuation class
Not sure why you are implementing continuation as you are not even using Labels and importantly you are returning something from database and not from external system.
However, you will need labels ...
1
vote
DML operations in the Apex callback method
We had the same issue for an LWC we had created, turned out it was not due to the Continuation it was because we had used the @wire service to make the call. I am guessing the @wire service forces ...
1
vote
call out method is not called in a continuous class, call out from VF page
From the documentation of Continuation.
A user invokes an action on a Visualforce page that requests
information from a Web service (step 1). The app server hands the
callout request to the ...
1
vote
Accepted
Chaining Continuations - would each continuation be executed in separate transaction/limit scope?
Asynchronous Callout Limits: When a continuation is executing, the continuation-specific limits apply. When the continuation returns and the request resumes, a new Apex transaction starts. All Apex ...
1
vote
Accepted
Aura Component + HttpCallout + Large File Response
If you go via apex, the heap limitations will apply.
The workaround is to do a callout from javascript. Yes you can do that.
By default, you can’t make calls to third-party APIs from client-side
...
1
vote
Callback method not getting called in Continuation Object
The callback method name mentioned in your continuationMethod1 method is processResponse, hence when a response is received it will look for processResponse method which is not available in your class,...
1
vote
Continuation Apex Unit Testing - Lightning
I tried making few changes to your code and this may be a solution although it does require adding an additional method in your main class.
Apex Class :
public class ContinuationSampleCode {
...
1
vote
Accepted
will Continuation works in Visual Flow?
If I read your question right, you are looking to find if Continuation will work in Visual Flow.
Based on the documentation, and all available resources, the answer seems to be No. By definition, ...
1
vote
Continuation obj null in setContinuationMethod
You don't have to instantiate 3 different Continuation objects to test 3 different webservices.
Only single instance of Continuation object will work.
I have tried to replicate your use case using ...
1
vote
Continuation Error: StatusCode=400
The issue was with the improper request body and hence I was getting error. When the request body is formatted properly, I am able to get the proper response.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
continuation × 54apex × 27
visualforce × 10
callout × 10
lightning-aura-components × 7
lightning × 7
asynchronous × 7
lightning-web-components × 4
httprequest × 4
unit-test × 3
rest-api × 3
api × 2
visual-workflow × 2
integration × 2
soap-api × 2
code-coverage × 2
webservices × 2
rest × 2
platform-event × 2
wsdl2apex × 2
visualforce-component × 1
permissions × 1
governorlimits × 1
apexrest × 1
lightning-community × 1