I have a class where I have declared @RemoteAction
functions to work using Javascript Remoting.
When I only had one function everything was working fine, but when I created a second @RemoteAction
function the browser console was displaying the following error:
Visualforce Remoting Exception: Method 'getCallsDetail' not found on controller RqaCallsList. Check spelling, method exists, and/or method is RemoteAction annotated.
I checked the javascript code and also the Apex code and everything is ok, there are not problems with the names or anything like that.
Javascript code:
RqaCallsList.getCallsList(startDate, endDate, token, function(result,event){
if(event.status){
results = result;
var headers = ['Date','Campaign','Campaign Type','Disposition','Agent','Call Recording','QA Score','ANI','DNIS'];
var tableContent = createTable(results,headers);
table.empty();
table.append(tableContent);
toDataTable(table);
$j('#loading').hide();
}
});
}
RqaCallsList.getCallsDetail(startDate, endDate, token, function(result,event){
if(event.status){
results = result;
var headers = ['Date','Campaign','Campaign Type','Disposition','Agent','Call Recording','QA Score','ANI','DNIS'];
var tableContent = createTable(results,headers);
table.empty();
table.append(tableContent);
toDataTable(table);
$j('#loading').hide();
}
});
}
Apex code:
@RemoteAction
public static List<Call__C> getCallsList(String startDate, String endDate, String token){
calls = new List<Call__c>();
identifier = sendCallLogRequest(startDate, endDate, token);
isRunning = checkCallLogIsRunning(identifier, token);
if(isRunning)
calls = getCallLogResult(identifier, token);
else{
MessageManager.addMessage(ApexPages.Severity.ERROR, 'The call log service is not running');
return null;
}
return calls;
}
@RemoteAction
public static List<Call__C> getCallsDetail(String startDate, String endDate, String token){
calls = new List<Call__c>();
identifier = sendCallLogRequest(startDate, endDate, token);
isRunning = checkCallLogIsRunning(identifier, token);
if(isRunning)
calls = getCallLogResult(identifier, token);
else{
MessageManager.addMessage(ApexPages.Severity.ERROR, 'The call log service is not running');
return null;
}
return calls;
}
The syntax is correct because I'm using a Static Resource where I have all the javascript functions.
What could be wrong with my code?