Compare attritbutes

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
christopherb
Posts: 304
Joined: Fri Jun 22, 2007 8:26 pm

Compare attritbutes

Post by christopherb »

There is something i'm missing here... here's the scenario

3 Objects
Customer (parent)
Invoice (Child)
YrTotals (Child)

Simple in the fact that a customer has an invoice and yearly totals are kept in the YrTotals for all of a customers invoices. Here is a rule in questions on the customer OB;

BookSalesCustomer.YearTotals.TotalBooksOrdered=SUM BookSalesInvoice.InvoiceOrderQty WHERE (BookSalesInvoice IN BookSalesCustomer.Invoice)

This all works fine for testing but of course it would update every instance in the YrTotal BO. So lets as some conditions in. And this is where the trouble comes in. I have tried to match the year attribute of the Invoice BO to match the year attribute of the Yr Total BO, such as;

BookSalesCustomer.YearTotals.TotalBooksOrdered=SUM BookSalesInvoice.InvoiceOrderQty WHERE (BookSalesInvoice IN BookSalesCustomer.Invoice AND BookSalesInvoice.Year=YrBookSales.Year)

But with trying even several syntax changes I can't get this to work. I am missing something really dumb i'm sure.

Chris
Cheers,

Christopher
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

This rule on YearTotals should take care of it:

YearTotals.Amount=SUM Invoice.Amount WHERE (Invoice.Customer=YearTotals.Customer AND Invoice.Yr=YearTotals.Yr)

Tom
Post Reply