Activity Forums Salesforce® Discussions Salesforce Error: Invisible Future Method in Test Class?

  • Suraj

    April 10, 2017 at 2:06 pm

    I created a Future Method and Now When I Call it in Test Class Error Occurs that "Future method invisible"?

    I used "@future static void countContacts(Parameter)"

  • Saurabh

    April 12, 2017 at 5:47 am

    Hi Suraj,

    In order to make the future method visible in Test Class you need to make the Future method public.Use this Syntax

    @future public static void countContacts(Parameter)

    Hope this will help you.


  • Avnish Yadav

    September 30, 2018 at 1:14 am


    Problem in your test class is that you are try to access the private method in your test class. Which is wrong.
    As per your code you need to call only VerifyDate.CheckDates(,; method which will call your private method in class.

    So simply copy paste below test class and try

    @isTest  public class TestVerifyDate {
    static testMethod void testMethod1()
    Date d = VerifyDate.CheckDates(,;         Date d1 = VerifyDate.CheckDates(,;


Viewing 1 - 3 of 3 posts

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos