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
Madhu3006Madhu3006 

AJAX tool kit and log file

Hi Everyone,

 

I am new to ajax tool kit.

The code works fine,since i am using the log to write the log .

But the log are not getting displayed in debug logs.

Where to see that logs can any one help me out

 

Thanks

 

 

<apex:page >

<script type="text/javascript">
var __sfdcSessionId = '{!GETSESSIONID()}';
alert( __sfdcSessionId);
</script>
<script src="../../soap/ajax/27.0/connection.js"
type="text/javascript"></script>
<script type="text/javascript">

window.onload = setupPage;
function setupPage()
{
try{
result = sforce.connection.query("Select Name, Id from Account");

records = result.getArray("records");
for (var i=0; i< records.length; i++) {
var record = records[i];
alert(record.Name + " -- " + record.Id);
log(record.Name + " -- " + record.Id);
}
}catch(error) {
if (error.faultcode.indexOf("INVALID_QUERY_SCOPE") != -1) {
log("check for the query");
} else {
log(error);
}
}

}
</script>
<div id="output"> </div>

</apex:page>

kiranmutturukiranmutturu
log method that you used refers to javascript API..and it write the issues to error console of the browser that you are using not in salesforce ......and if you got any issues in the action you defined it automatically available in the respective logged in user debug in salesforce...if you want to see the specific errors in the page then you can add <apex:pagemessages/> tag....
Madhu3006Madhu3006

Suppose if i use the alert i can see all the records

 

alert(record.Name + " -- " + record.Id);

i want to write the log


log(record.Name + " -- " + record.Id);

 

where can i see all the records .

 

Regards

Madhu

 

 

kiranmutturukiranmutturu
where you want to log this in salesforce ?