Hi, would appreciate help with the following dilemma.
I have a tableview form based on product and it has relation with product_to_lines
Lines table has aggregrate function field totaling value column
columns displayed are - product.code, product.name, lines.sum_value - being totals of filtered transaction lines for a given date range.
If I set the lines table filter to the product range and date range required, I still get the total for all lines in the database displayed.
When the filter is applied only products that had sales during the filtered period are included, so filter is applying.
Should this work as described, and if so what could I be doing wrong.
Maybe if I could see the sql that is being applied that would help. Is it possible to view it?
Filter code used :
function onFilter(event) {
// Set user filter
if(controller.find() ) {
//Date
if(vFromDate && vToDate) {
fixproduct_to_fixlines.linstart = '#' + utils.dateFormat(vFromDate,'dd-MM-yyyy') + ' ... ' + utils.dateFormat(vToDate,'dd-MM-yyyy') + '|dd-MM-yyyy'
}
// Product Range
if(vStkStart && vStkStop) {
prdcode = vStkStart + '...' + vStkStop
}