I'm trying to call an Apex function from a Visualforce page, but my Apex function isn't getting hit. What am I doing wrong?
I have this
ct_4_sf.RecordingTest.saveRecording(
paths,
function(data){
console.log('data is ',data);
}
);
Which is supposed to call this:
public with sharing class RecordingTest {
@RemoteAction
public static String saveRecording(String data) {
System.debug('hit save recording' + data);
return Connector.saveRecording(data);
}
}
But the System.debug line never gets hit.
I've also tried it this way
Visualforce.remoting.Manager.invokeAction(
'{ct_4_sf.RecordingTest.saveRecording}',
paths,
function(data){
console.log('data is ',data);
}
);
with the same result.
For this method, using !$RemoteAction instead of, or in front of ct_4_sf gives me compilation errors. Removing ct_4_sf(which is the namespace under Setup > Create > Packages), from the first method doesn't help.
I'm not getting any errors in the console or anywhere else.
RemoteActionmethods global. 2) Are you sure your log levels are high enough?ct_4_sf? UsingRecordingTest.saveRecording( params )in the JavaScript of your VF page should work as you don't appear to have a namespace to deal with.ct_4_sfprefix, which is the namespace defined in Setup > Create > Namespace Prefix, and that didn't helppathsvar you are passing in? If it is notStringthat could be the cause...