function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Aditi Singh 41Aditi Singh 41 

How to wait for future method.

I am doing REST call in a future method, the success response in stored in a custom object. This REST calls create few records in some object. I need to copy data from he records created from response to a new object.
But I am unable to do so as future method takes time to complete. Can anyone help me, so that I can use the future method response.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi Aditi,

I hope you may not be able to do that because Future call is independant call which happens when ever resourses are available. So you cannot track the response of this and use this in the other method. 

Instead I guess as you are telling this future method is creating some records may be use can try using the trigger associated to that trigger to perform the action what you need.

If this solution helps, Please mark it as best answer.

Thanks,