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
JohnPCutlerJohnPCutler 

JavaScript Error "log is not defined" while trying sforce.debug.log

I am trying the following code in an OnClick SControl

Code:
{!requireScript("/soap/ajax/11.1/connection.js")}

sforce.debug.trace = true;
sforce.debug.log("Hello World");

and I am getting a browser error which says "log is not defined"

When I use Firebug to inspect connections.js I see the following code ...

Code:
sforce.internal.Debug = function() {

...

this.log = function(str) {
  this.println(str, "print");
}

sforce.debug = new sforce.internal.Debug();

 I am confused. Shouldn't this be working? This stopped working in an old SControl I built, so I am sure something has changed.

Any help would be appreciated

John

 

DhanavelDhanavel

User Console.log('Value')

 

function callscript() {
var result = sforce.connection.queryAll("Select Name, Id from Account");
var records = result.getArray("records");

for (var i=0; i<records.length; i++) {
var record = records[i];
console.log(record.Name + " -- " + record.Id);

}

}