Hi there,
I have a
sales_Form. Inside sales_Form I have a
sub_Form where I have a
product_Lookup_Field and
product_subTotal. I need to display a table with "Product Name" and "sub total" for a specific period.
I have tried different ways to solve it but obviously its not enough...! This is the best I've got so far...(I am changing the names to make it easy for you to understand). This solutions gives me the product name on a new td but the sum displays the sum of all products in this specific subform.
Any ideas???? Many many many thanks for your time!
<%
for each r in Products //this is the Products form
{
product = r.Product;
productID = Products[Product == product].ID;
sd = sales_Form[sub_Form.product_Lookup_Field == productID && date_of_sale == '16-Oct-2017'].sub_Form;
sales = sd.sum(product_subTotal);
%>
<tr>
<td><%=product%></td><td><%=sales%></td></tr>
<%
}
}%>