<apex:page standardController="Product_Set__c" id="ProductSetRollup" readOnly="true" showHeader="false" sidebar="false">
|
<div class="bPageBlock brandSecondaryBrd bDetailBlock secondaryPalette">
|
<table class="detailList" border="0" cellpadding="0" cellspacing="0">
|
<tr>
|
<td class="labelCol" style ="border-bottom:0px;">
|
{!$ObjectType.Product_Set_Detail__c.fields.Stop_Quantity__c.Label}
|
</td>
|
<td class="dataCol col02 inlineEditLock" style="padding-left:5px; border-bottom:0px;">
|
<apex:outputField value="{!Product_Set__c.Quantity__c}" id="Sum_Stop"/>
|
</td>
|
</tr>
|
</table>
|
</div>
|
<script src="/soap/ajax/30.0/connection.js" type="text/javascript"></script>
|
<script type="text/javascript">
|
var psId = '{!Product_Set__c.Id}';
|
// sforce.connection.sessionId = '{!$Api.Session_ID}';
|
var resultSet = sforce.connection.query(
|
"SELECT Count(Id) Cnt_Id, Sum(Contain_stop_product__c) Cnt_Stop, Sum(Stop_Quantity__c) Sum_Stop" +
|
" FROM Product_Set_Detail__c" +
|
" WHERE Product_Set__c = '" + psId + "'" +
|
" GROUP By Product_Set__c"
|
);
|
var records = resultSet.getArray("records");
|
if (records != null && records.length > 0) {
|
var aggregateResult = records[0];
|
document.getElementById("ProductSetRollup:Sum_Stop").innerText = parseInt(aggregateResult.Sum_Stop);
|
} else {
|
document.getElementById("ProductSetRollup:Sum_Stop").innerText = "";
|
}
|
</script>
|
</apex:page>
|