i am getting this error on clicking a button. ---- A problem with the onclick javascript forthis button or link was encountered:{faultcode:'soapenv:Client',faultstring: No operation available for request {http://soap.sforce/schemas/package/close_date_updation} crUpdated, please check the WSDL for this}
Since i am new to java script please someone help me out.
My javascript code on button is-
{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}
//Call insertJob method by passing that Opportunity id
sforce.apex.execute("Close_Date_Updation","crUpdated",{oppId:"{!Opportunity.Id}"} );
//Redirect to that tab
window.location = 'https://ap2.salesforce.com/006/o';
My class & method is--
public class Close_Date_Updation
{
public static void crUpdated(ID oppId)
{
System.Debug('---------------->>>>>>>>>' + oppId);
List<Opportunity> opportunityList = [Select id,Master_Opportunity__c,Service_Start_Date__c,Revision_Date__c,CloseDate from Opportunity where id=:oppId];
Map<Id, Opportunity> OppMap = new Map<Id, Opportunity>(opportunityList);
List <Opportunity> childRecord = [Select id,Revision_Date__c,Service_Start_Date__c,CloseDate,Master_Opportunity__c from Opportunity where RecordType.DeveloperName = 'Child_Opportunity' And Master_Opportunity__c IN: opportunityList];
for(Opportunity ChildRecordObject : childRecord){
opportunity opportunityObject = OppMap.get(ChildRecordObject.Master_Opportunity__c);
ChildRecordObject.Service_Start_Date__c = Date.valueOf(opportunityObject.Service_Start_Date__c).adddays(-1);
ChildRecordObject.Revision_Date__c = Date.valueOf(opportunityObject.Revision_Date__c).adddays(-1);
ChildRecordObject.CloseDate = Date.valueOf(opportunityObject.CloseDate).adddays(-1);
}
upsert childRecord;
}
}