function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
OlbrestOlbrest 

I got a error message - "No operation available for request"

Hello, Sirs.

During apex.execute I got an arror - "No operation available for request".

It's a visualforce page.

When I use the same code on the Scontrol page, I have not get any errors.

How I can get data from class to javascript ?
Seems like philosophy of visualforce does not let it. Is it so ?

Thank you.


Code:
<apex:page controller="Controller">
<script type="text/javascript" src="/soap/ajax/13.0/connection.js"></script> 
<script type="text/javascript" src="/soap/ajax/13.0/apex.js"></script> 
<script type="text/javascript" src="/js/functions.js"></script>
<script language="javascript">

sforce.debug.trace = true;
sforce.connection.sessionId = "{!$Api.Session_ID}";

function test(){

var result = sforce.apex.execute("Controller","Testa",{Text: 'hello there'});
alert('test');
}

</script>
<input type="button" onclick="test();" value="Test" class="btn"/>
</apex:page>

 
Code:
global class Controller {
WebService static String Testa(String Text) {
return Text;
}

 



Message Edited by Olbrest on 01-17-2009 07:48 AM
Best Answer chosen by Admin (Salesforce Developers) 
sgoldberRHsgoldberRH
I include this in my code and it resolved this issue for me

<apex:includeScript value="/soap/ajax/15.0/connection.js"/> <script type="text/javascript" src="/js/functions.js"></script> <script src="/soap/ajax/15.0/apex.js"></script>

 

All Answers

mtbclimbermtbclimber
Why are you using the API from the client to invoke an apex method when you can call methods in your controller directly?
OlbrestOlbrest
Thank you.

 I has solved my problem.
sgoldberRHsgoldberRH
I am having the same problem.....how did you fix it?
sgoldberRHsgoldberRH
I include this in my code and it resolved this issue for me

<apex:includeScript value="/soap/ajax/15.0/connection.js"/> <script type="text/javascript" src="/js/functions.js"></script> <script src="/soap/ajax/15.0/apex.js"></script>

 

This was selected as the best answer