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
Roy LuoRoy Luo 

Invalid Interface name Queueable and System.enqueueJob Method is not implemented exception

I have a dev org working fine with the new Queueable interface. Then I need to setup a new org for QA and that org won't compile class implementing Queueable. Some dude suggested changing it to 'queueable' and that seems to fool the compiler, but codes never get run and workbench apex execute tells me this 'COMPILE ERROR: Method does not exist or incorrect signature: System.enqueue(new QTest())'. Is there any config setting I need to turn on in order to use Queueable? Class and codes are on api version 32.0.

Here  is my superduper class:

public class QTest implements Queueable
{
      public void execute(QueueableContext context) 
      {
          System.debug('get here QTest.execute');
      }
}
With 'Queueable' instead of 'queueable', the comipler erros out with this:
"Error: Compile Error: Invalid Interface name provided at line 1 column 14"

Codes at workbench:

QTest q = new QTest();
System.enqueueJob(q);

The error from workbench results:
COMPILE ERROR: Method does not exist or incorrect signature: System.enqueue(QTest)
LINE: 3 COLUMN: 1
Best Answer chosen by Roy Luo
Roy LuoRoy Luo
Submitted a support case to SalesForce and it turned out for winter15 version, you still need to request for Queueable and SalesForce would turn it on. Now all work. Why isn't it documented anywhere?

All Answers

Roy LuoRoy Luo
Submitted a support case to SalesForce and it turned out for winter15 version, you still need to request for Queueable and SalesForce would turn it on. Now all work. Why isn't it documented anywhere?
This was selected as the best answer
Roy LuoRoy Luo
Another note for Queueable unit test. System.enqueueJob will do some monkey business for the unit test flow and it would throw exception on Test.startTest();

See the code below, without this line 'if(Test.isRunningTest()) return;', Test1 would pass, but Test2 and Test3 would throw exception on line Test.startTest complaining Test.startTest is only allowed in unit test, but it is in unit test method. Isn't it interesting? Hope this helps. It took me a long time to figure this out. 
 
public class ActionHandler
{
        public static void DoTrick()
        {
              if(Test.isRunningTest()) return;
              System.enqueueJob(new SuperDuperQueueable());
        }
}

public class SuperDuperQueueable implements Queueable {
  public void execute(QueueableContext context)
  {
      System.debug('Get here SuperDuperQueueable');
  }
}
 
@isTest
private class SuperDuperQueueable_Test
{
    static testmethod void Test1()
    {
        Test.startTest();        
        ActionHandler.DoTrick();
        Test.stopTest();
    }
    
    static testmethod void Test2()
    {
        Test.startTest();        
        ActionHandler.DoTrick();
        Test.stopTest();
    }
    
    static testmethod void Test3()
    {
        Test.startTest();
        ActionHandler.DoTrick();
        Test.stopTest();
    }
}
Dale ChenDale Chen
It doesn't appear to be rolled out to all servers/instances.  We are still receiving this error in our developer instances as well as when we try to do a push upgrade with our managed package.