1

Apex:

global with sharing class SomeClass {
  @RemoteAction
  @AuraEnabled(Cacheable=true)
  global static Id someMethod() {
    return u.Id;
  }
}

VF:

<apex:page controller="SomeClass">
...
<script>
...
  Visualforce.remoting.Manager.invokeAction(namespace + 'SomeClass.someMethod', () => console.log("success"))
</script>
</apex:page>

This is the essence of what I'm trying to accomplish in my code, but I'm getting the following warning and error respectively:

Controller not found for 'namespace__SomeClass'

Unable to invoke action 'namespace__SomeClass.someMethod': no controller and/or function found

This works in my unmanaged package but does not work in my managed package. Does anyone know what might be going wrong?

1
  • Have you tried invokeAction('{!$RemoteAction.namespace.SomeClass.someMethod}' instead?
    – sfdcfox
    Commented Oct 6, 2021 at 15:34

1 Answer 1

0

Figured it out: namespace + 'SomeClass.someMethod' resolved to namespace__SomeClass.someMethod, instead i need to input namespace.SomeClass.someMethod

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .