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
John L.John L. 

How do I post messages to the Debug Log from (client-side) JavaScript?

I'm able to make Debug Log entries from (service-side) APEX code via System.debug() calls, and referring to Setup+Monitoring+Debug Logs+...
 
From using the various resources at my disposal, I understand that the following should accomplish the subject task:
Code:
<script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script>

 
Code:
sforce.debug.trace=on;
if (sforce.debug.trace) { sforce.debug.log("This is the message inserted into the Debug Log.");}

Alas, this does not work as expected (and I suspect the referenced ajax level is downlevel also).
 
Thanks  in advance for any help you could provide to accomplish the desired task.

John L.John L.
I meant the above post to read:
Code:
sforce.debug.trace=true;

 
("true", NOT "on"). 
 
Sorry for any confusion this may have caused.
Eva DeLoriolEva DeLoriol
Hi John, have you tried using a newer version of the connection.js?  

<script type="text/javascript" src="../../soap/ajax/26.0/connection.js"></script>

I haven't tried it, but it could be a starting point.