logo
MENUMENU
  • Services
        • Salesforce

        • Salesforce OverviewWe help our clients to make the most out of their technology investments.
          • Salesforce Overview
          • Systems Integration
          • Managed Services
          • Field Service Lightning
          • Salesforce CPQ
        • Verint

        • Verint OverviewOur services cover Implementations, Upgrades, Migrations, Reporting Solutions & Application Support.
          • Verint Overview
          • Verint Knowledge Management
          • Verint KM Integrations
          • Verint Omni-Channel
          • Verint Unified Desktop & Case Management
          • Verint Workforce Optimization
          • Verint Intelligent Virtual Assistant
          • Verint Robotic Process Automation
        • Artificial Intelligence

        • Artificial Intelligence
          • AI Overview
          • Data Engineering
          • Analytics/BI
          • Predictive Analytics
          • Computer Vision
          • Natural Language Processing (NLP)
          • ML Ops
        • Cloud & Mobile Apps

        • Cloud & Mobile App Development OverviewOur services cover Implementations, Upgrades, Migrations, Reporting Solutions & Application Support.
          • Cloud & Mobile App Development Services
        • Let’s Get
          Started.

        • Let’s talk about how SPAR Solutions
          can positively impact your business.

        • START TODAY
  • Company
    • About Us
    • Why Work At SPAR
  • Resources
    • Blog
    • Case Studies

GET STARTED 1-855-772-7765

GET IN TOUCH
  • Services
    • Salesforce Overview
      • Salesforce Overview
      • Systems Integration
      • Managed Services
      • Field Service Lightning
      • Salesforce CPQ
    • Verint Overview
      • Verint Overview
      • Verint Knowledge Management
      • Verint KM Integrations
      • Verint Omni-Channel
      • Verint Unified Desktop & Case Management
      • Verint Workforce Optimization
      • Verint Intelligent Virtual Assistant
      • Verint Robotic Process Automation
    • Artificial Intelligence
      • AI Overview
      • Data Engineering
      • Analytics/BI
      • Predictive Analytics
      • Computer Vision
      • Natural Language Processing (NLP)
      • ML Ops
    • Cloud & Mobile App Development Overview
      • Cloud & Mobile App Development Services
  • Company
    • About Us
    • Why Work At SPAR
  • Resources
    • Blog
    • Case Studies

What is a Future Method

Home > How to > What is a Future Method

What is a Future Method

May 27, 2021 Leave a Comment

In the last How To Salesforce, we covered what to do when SOQL ignores null checks on required lookup fields.

In today’s post, we are going to cover a few key points when working with Future Methods. But before we do, let’s talk about what a Future Apex is. Future Apex is used to run processes in a separate thread, at a later time when system resources become available.

A Future Method runs in the background asynchronously. You can call a Future Method for executing long-running operations, such as a callout to external Web Services or any operation you’d like to run in its own thread and/or on its own time.

You can also use future methods to isolate DML operations on different sObject types to prevent the mixed DML error.

Future Methods are typically used for:

  • Callouts to external Web services.
  • Operations you want to run in their own thread
  • Isolating DML operations on different sObject types to prevent the mixed DML error.

develop, preview, ship coffee mug

To define a future method, simply annotate it with the future annotation, as follows:

global class FutureClass

{

@future

public static void myFutureMethod()

{

// Perform some operations

}

}

 

Important points to be remembered:

  1. Methods with the future annotation must be static methods, and can only return a void type.
  2. The specified parameters must be primitive data types, arrays of primitive data types, or collections of primitive data types.
  3. Methods with future annotation cannot take sObjects or objects as arguments.
  4. We can’t call a future method from the future method.
Ali Adib
+ posts
  • Ali Adib
    https://sparsolutions.com/author/ali-adibsparsolutions-com/
    The Ins and Outs of Knowledge Management Systems
  • Ali Adib
    https://sparsolutions.com/author/ali-adibsparsolutions-com/
    Top Benefits of Salesforce and ERP Integrations
  • Ali Adib
    https://sparsolutions.com/author/ali-adibsparsolutions-com/
    SPAR’s Commitment to Diversity, Equality and Inclusion
  • Ali Adib
    https://sparsolutions.com/author/ali-adibsparsolutions-com/
    The Top 5 Key Features of Salesforce Field Service Lightning

Filed Under: How to

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Apex Testing
  • Big Data
  • Force.com Development
  • General
  • Healthcare
  • Highlighted
  • How to
  • Integration
  • Knowledge Management
  • Salesforce Field Service Lightning
  • Salesforce.com
  • SFDCHighlights
  • Uncategorized

Archives

  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • March 2021
  • January 2021
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • March 2019
  • June 2017
  • December 2016
  • June 2016
  • December 2015
  • November 2015
  • October 2015
  • July 2015
  • February 2015
  • January 2015
  • October 2013
  • February 2013
  • January 2013
  • December 2012

Ready to Get Started?

Let’s talk about how SPAR Solutions can help you drive greater automation

Get in Touch

Ask us how to get started today.

SPAR Solutions logo

Terms of Service

OFFICE

375 Northridge Rd
Suite #400
Atlanta, GA 30350

CALL US

1-855-772-7765

Copyright © 2020, All Rights Reserved by SPAR Solutions. Digital Marketing by