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
EguiEgui 

Custom controller compilation error

Hello,

I running in a very strange issue, I've written a custom controller and it's working fine when I test it.

But when I try to execute the test I get the following error : CompileFail : line 65, column 47: Constructor not defined: [ALS_REDIRECT_CONTROLLER].<Constructor>(NULL)

and if I try recompile all apex classes, I get this error : line 65, column 47: Constructor not defined: [ALS_REDIRECT_CONTROLLER].<Constructor>(NULL)

I can't manage to find the solution here, could you please advise ?

Thanks a lot.
Ashish_SFDCAshish_SFDC

Hi , 


Can you please post the code and mark the error line so that we further look into. 

See the thread below with similar error, 

https://developer.salesforce.com/forums?id=906F000000092uvIAA


Regards,

Ashish

Ramki DhananjayRamki Dhananjay
Hi,

If your constructor is defined as Myconstructor() {  }
and if you create an instance in your test class like object obj = new object() it would work fine 

else your constructor is defined like Myconstructor(ApexPages.StandardController stdController){   }
then in your test class create an instance like this.
Apexpages.StandardController sc = new Apexpages.standardController();
object obj = new object(sc).

regards,
ram
EguiEgui
Thnaks all for your answers.

I finally found the error, the test class was failling recompilation.