I am using the ajax/connection js on a custom visual force page

<apex:includeScript value="/soap/ajax/34.0/connection.js"/>
<apex:includeScript value="/soap/ajax/34.0/apex.js"/>

I am trying to execute this method within the subsequent Class

public String resetPassword()
public class MemberPoliciesController

This is the javascript that is calling the method

function changePassword(){
    sforce.connection.sessionId = "{!$Api.Session_ID}";
    alert("I am here");

I am being alerted with the 'I am here' text. I have System.debug() logs in the resetPassword method and it doesn't seem as if the method is being called. What could be the issue?

  • You should be seeing JS errors ( unless you have prevented the page from creating further popups) showing a fault code. You need to mark your class global and method as webservice to use sforce.apex.execute
    – Rao
    Aug 4 '15 at 16:26
  • have your checked the javascript console to see if an exception is getting thrown?
    – NSjonas
    Aug 6 '15 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.