How to use method "Future in Apex" - Domreysa

Post Top Ad

Post Top Ad

Thursday, November 21, 2019

How to use method "Future in Apex"

Future method is used to run code that took to long to process, so if you don't want to wait it working, you can used this @future for running it as backgound.
public PageReference TestOne()
    {
        
        TestTwo('This is future method');
        return null;
    }

@future(callout=true)
private static void TestTwo(String desc){
 System.debug(desc);
}

No comments:

Post a Comment

Post Top Ad

Responsive Ads Here