+ Start a Discussion

A problem with the OnClick JavaScript for this button or link

I am writing an apex button to invoke a class and am recieving the following error:


A problem with the OnClick JavaScript for this button or link was encountered:

{faultcode:'soapenv:Client', faultstring:'No operation available for request {http://soap.sforce.com/schemas/package/ProductDescription}SplitDescription, please check the WSDL for the service.', }


The apex class and the javascript have the same class.


// Include and initialize the AJAX toolkit library
var idList = {!GETRECORDIDS($ObjectType.QuoteLineItem)};
var retURL = window.location.toString();
var proceed = true;
if(idList.length == 0){
alert('Please select at least 1 record.');
proceed = false;
if(idList.length != 0){
var myvar = sforce.apex.execute("ProductDescription","SplitDescription",{QuotteLinetem_id:idList})


 Class un version 26.0

Global class ProductDescription {

    List<String> xarray = new List<String>();
    QuoteLineItem qli {get; set;}
    id idlist;
    public ProductDescription(ApexPages.StandardController c) {
        qli = [select id from Quotelineitem where id =: ApexPages.currentpage().getParameters().get('qli')];

   Public pageReference SplitDescription(){
   List<QuoteLineItem> cqli = [select id, pricebookentryid, PricebookEntry.Product2.Description
                                   from QuoteLineItem where id =:idList];

   For(Quotelineitem qli : cqli){
     xarray = qli.PricebookEntry.Product2.Description.split('\n');   
    Product_Description_Line__c[] split = new Product_Description_Line__c[0];
    For(String sa : xarray){
           split.add(New Product_Description_Line__c(quote__c = cqli[0].quoteid,
                    Quote_Line_Item__c = cqli[0].id,
                    Description_Line__c = sa

   insert split;

  return null;

 What am I doing wrong and how do I solve the error?


Thank you

Best Answer chosen by Admin (Salesforce Developers) 

Method  "SplitDescription" of class "ProductDescription" doesnt take any input argument and you are passing argument from your java script call


Please replace your call from {QuotteLinetem_id:idList} to {}


Also you can can try including "js" files for different version may be 15.0