1

I have a method in my Controller that is defined as:

@RemoteAction
global static Chart getChartObject( String chartName, String patient ){..}

The return value is a class defined inside the controller. When I attempt to call the method from the JavaScript using the following call;

Visualforce.remoting.Manager.invokeAction( '{!$RemoteAction.ChartController.getChartObject}', p, handleResult, handleFailure );

it fails. The error returned is that the method ChartController.getChartObject could not be found.

Any ideas of what to look for?

From what I can see in the documentation, this should work. I had a similar callback that returned a List of objects that were defined in the database. The one I'm attempting to return here is an Apex class but the documents state that it should be able to do that.

Thanks in advance.

1
  • 1
    Make sure that ChartController is the controller or extension for the page. Only the controller or extension's remote actions are available to a Visualforce page. – sfdcfox Jul 19 '13 at 13:26
2

It looks like you aren't passing the right number of parameters to the controller class. You getChartObject method needs a chartname and a patient. In your JS, it looks like you are only passing in one parameter, p.

2
  • That would be an incorrect parameters error, not a method not found error. JavaScript isn't "compiled" in the sense that parameters matter. – sfdcfox Jul 19 '13 at 13:24
  • I was passing null for the Patient parameter. I removed it and I'm back to working. I didn't try setting it to an empty string yet. That will be my next thing. Now I've run into other issues. – Robert Harper Jul 19 '13 at 15:22

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.