0

I am working with the lightning-container npm package and have a call in a React app uploaded as a static resource. This simply onClick, calls the LCC.callApex method as below.

LCC.callApex("MikeTestController.SayHi", "SomeText", callbackFunc, {escape:true});

My APEX controller looks like this:-

global class MikeTestController {

Public ApexPages.StandardController stdController;

Public MikeTestController(ApexPages.StandardController stdController){
    this.stdController = stdController;
}

@RemoteAction
global static String SayHi(string opportunityName) {
    return 'Hi';
}

}

I specify MikeTestController in the manifest.json file too. I get an error back onClick

Unable to invoke action 'MikeTestController.SayHi': no controller and/or function found after a warning Controller not found for 'MikeTestController'.

If I remove the constructor, it works fine. What is the issue here? Why would the presence of a constructor stop me calling other functions in the controller?

Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.