Рет қаралды 6,332
#masterDetail #Oracledatabase #OracleApex #Sql #PLSql #javascript
In this video, I have explained how to calculate total & grand total in master-detail form with Interactive Grid in oracle apex 20.2 in detail.
---------------------Facebook Link--------------------------------
/ namoraapexify
------------------Master-Detail Form--------------------------------------
• How to create manual a...
------------------------------Grand Total showing in tabular Form---------------------
• How to display grand t...
// for calculating total
var qty = ($v("C_QTY") != "")?parseFloat($v("C_QTY")):0;
var price = ($v("C_PRICE") != "")?parseFloat($v("C_PRICE")):0;
var tot = 0;
if(!isNaN(qty) && !isNaN(price)){
tot = qty*price;
}
$s("C_TOTAL", tot);
// For calculating Grand Total
var model = apex.region("item_dtl").widget().interactiveGrid("getViews", "grid").model;
var qtyKey = model.getFieldKey("QTY");
var totKey = model.getFieldKey("TOTAL");
var totQty = 0;
var totAmt = 0;
model.forEach(function(r) {
var qty = parseFloat(r[qtyKey], 10);
var tot = parseFloat(r[totKey], 10);
if (!isNaN(qty)) {
totQty += qty;
}
if (!isNaN(tot)) {
totAmt += tot;
}
});
$s('P83_TOTAL_QTY',totQty);
$s('P83_GRAND_TOTAL',totAmt);