4

This invokeAction used to work, and around Nov-1-15 stopped working (not sure if this is related to winter 16 or not)

It is included on a component, and the controller for the component is where the @RemoteAction is included. The {!$RemoteAction.xxx} code evaluates correctly (and it correctly fails if I remove the @RemoteAction annotation from the controller). The error appears when JS actually tries to invoke it.

COMPONENT PAGE

<apex:component controller="SuppressionRulesComponentController" allowDML="true">

<script>
    $( document ).ready(function() {
        getAllObjects();
    });


function getAllObjects() {
   //The line below is where it all fails
    Visualforce.remoting.Manager.invokeAction(
        '{!$RemoteAction.SuppressionRulesComponentController.getAllObjects}',
        function(result, event) {
             if (event.status) {         
                console.log(result);
            } else {
                //Error Handling
            }

        },      
        {buffer: true, escape: true}
    );

}

</script>
<apex:form >
</apex:form>

CONTROLLER

public with sharing class SuppressionRulesComponentController {
@RemoteAction
    public static List<ObjectData> getAllObjects() {
        //Code goes here. This never executes
    }
}

CONSOLE ERRORS

(Warning) Controller not found for 'SuppressionRulesComponentController'
(Error) Unable to invoke action 'SuppressionRulesComponentController.getAllObjects': no controller and/or function found
1
2

Update: This is a SFDC bug, confirmed by their team. success.salesforce.com/issues_view?id=a1p300000008azEAAQ

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.