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
sushma76sushma76 

Javascript code cannot find the page.

I am trying to figure out, what page or trigger this custom button is calling from this code.

 

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

{!REQUIRESCRIPT("/soap/ajax/15.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/15.0/apex.js")}

//GET OPPORTUNITY ID AND PARSE CORRECTLY
var urlstr=(document.URL);
var str=(urlstr);
var n=urlstr.split("/");
var w=n[2];
var x=n[3];
var z=x;
var QuoteHeaderID = x;
//alert(x);

var goNow = sforce.apex.execute("AddProductLines","donothing",{QuoteHeaderID:x});

window.location.href=(goNow);

 

/////////////////////////////////////////////////////////////////////

 

The *AddProductLines" is not under Pages. I am unable to understand exactly what is this and where should I get this info?

 

The Developer who built this form has left, so trying to understand. Please help.

ashishkrashishkr

This is using apex in AJAX.

 

var goNow = sforce.apex.execute("AddProductLines","donothing",{QuoteHeaderID:x});

The above lines tells that "AddProductLines" is an Apex Class (that's the reason you did not find it under pages,) "donothing" is a method inside this class and {QuoteHeaderID:x} passes the parameter. I'm guessing your method is declared as below:

 

global class AddProductLines { 
  webService static String donothing(String QuoteHeaderID) { 
       //some code.
    }
}

 Refer here.