• Operations
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I'm not a developer and I know I am treading in deep waters with javascript in s-controls.  I am trying to print out an order summary.  I can print out all the basic fields from the opportunity but I am trying to also list the lineitems on the opportunity on the same html page. 
 
I hunted for as much similar code on the app exchange and hacked this together.  If anyone could help me I would really appreciate it.
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="/dCSS/Theme2/default/common.css" type="text/css" rel="stylesheet" >
<script src="http://www.salesforce.com/services/lib/ajax/beta1/sforceclient.js"
type="text/javascript"></script>


<script language="javascript">
<!--

function initPage() {

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
window.setTimeout(";", 1000);


/**
This is a function to retrieve the line items from the opportunity record. */
function getLineItems() {
//Querying salesforce for the Line Items associated to the given opportunity.
qr = sforceClient.Query("Select Id, Quantity, SalePrice, PricebookEntryId From OpportunityLineItem Where OpportunityId='{!Opportunity_ID}'");

}

//Get the data records from the QueryResult.
oliArray = qr.records;
}


function drawtable(){
<table>
<tr> <td> Select ID </td>
<td> Quantity </td>
<td> Sale Price </td>
<td> PricebookEntryID </td>
</tr>
for (i=0;i<oliarray.length;i++){
<tr>
for (j=0;j<oliarray[i].length;j++){
<td>
document.write('oliarray[i][j]');
</td>
}
</tr>
}
</table>
}


//-->
</script>

</head>

<body onload="PageInit();">
 
I'm not a developer and I know I am treading in deep waters with javascript in s-controls.  I am trying to print out an order summary.  I can print out all the basic fields from the opportunity but I am trying to also list the lineitems on the opportunity on the same html page. 
 
I hunted for as much similar code on the app exchange and hacked this together.  If anyone could help me I would really appreciate it.
 
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="/dCSS/Theme2/default/common.css" type="text/css" rel="stylesheet" >
<script src="http://www.salesforce.com/services/lib/ajax/beta1/sforceclient.js"
type="text/javascript"></script>


<script language="javascript">
<!--

function initPage() {

sforceClient.init("{!API_Session_ID}", "{!API_Partner_Server_URL_60}");
window.setTimeout(";", 1000);


/**
This is a function to retrieve the line items from the opportunity record. */
function getLineItems() {
//Querying salesforce for the Line Items associated to the given opportunity.
qr = sforceClient.Query("Select Id, Quantity, SalePrice, PricebookEntryId From OpportunityLineItem Where OpportunityId='{!Opportunity_ID}'");

}

//Get the data records from the QueryResult.
oliArray = qr.records;
}


function drawtable(){
<table>
<tr> <td> Select ID </td>
<td> Quantity </td>
<td> Sale Price </td>
<td> PricebookEntryID </td>
</tr>
for (i=0;i<oliarray.length;i++){
<tr>
for (j=0;j<oliarray[i].length;j++){
<td>
document.write('oliarray[i][j]');
</td>
}
</tr>
}
</table>
}


//-->
</script>

</head>

<body onload="PageInit();">