New answers tagged

3

You'll eventually want to move to batchable, but your code here can be optimized. I have no idea if the changes will be substantial enough to get under the CPU limits, but it's worth a try: Asset[] assets = [ SELECT Id FROM Assets WHERE AccountId IN ( SELECT AccountId FROM Order WHERE Cancel_All_Accounts__c = TRUE AND ...


-1

If authentication error occurs as 401-Unauthorized Header, even after using the correct http headers, try replacing the org instance in the endpoint with instance_url returned from authentication token web callout. Http h1 = new Http(); HttpRequest req1 = new HttpRequest(); **req1.setHeader('Authorization','Bearer '+ ...


0

The issue had to do with a performance problem over with Heroku. CPQ services hosted on Heroku were negatively impacted resulting in the loading screen and queued jobs. The issue resolved itself once the Heroku servers were back to full health (4 hours).


0

I have faced the same problem and I compiled all my apex classes. After that my schedulable class was located and I have scheduled it. So, try this option if you are still facing the issue


0

Use Queueable instead of @future. You're allowed one Queueable call per execute method of a Batchable, Schedulable, or Queueable class. Alternatively, you could store the records in a variable and make the callout during the next execute/finish method, but that's decidedly more complicated than it needs to be.


Top 50 recent answers are included