You need to sign in to do that
Don't have an account?
shan876
display result from query
hi all
I have wrote a s control to display something on the page... the only thing is it does not display anything and I know that it should Can someone please help me and tell me where am I going wrong
<html>
<head>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>
<script text="javascript">
var aid='0015000000KxU9SAAV';
function initPage()
//Get the account Number
{
var i,j;
result = sforce.connection.query("Select a.AS400_Account_Number__c, a.Id, " +
"(Select AccountId, CaseNumber From Cases) from Account a where a.Id='0015000000KxU9SAAV'");
records = result.getArray("records");
for (var i=0; i<records.length; i++) {
var record == records[i];
j ==(record.AS400_Account_Number__c);
}
};
/*****************************************************************************/
</script>
</head>
<body onload="initPage();">
</body>
</html>
Thanks
Zishan
I have wrote a s control to display something on the page... the only thing is it does not display anything and I know that it should Can someone please help me and tell me where am I going wrong
<html>
<head>
<script type="text/javascript" src="/soap/ajax/10.0/connection.js"></script>
<script text="javascript">
var aid='0015000000KxU9SAAV';
function initPage()
//Get the account Number
{
var i,j;
result = sforce.connection.query("Select a.AS400_Account_Number__c, a.Id, " +
"(Select AccountId, CaseNumber From Cases) from Account a where a.Id='0015000000KxU9SAAV'");
records = result.getArray("records");
for (var i=0; i<records.length; i++) {
var record == records[i];
j ==(record.AS400_Account_Number__c);
}
};
/*****************************************************************************/
</script>
</head>
<body onload="initPage();">
</body>
</html>
Thanks
Zishan
I left out some of your original code because it couldn't figure out what you were trying to do. Additionally, although the example loops through a records array it will only contain one row because your query statement explicitly looks for an individual Account Id.