SUM partially working

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
Post Reply
Mark HHP
Posts: 387
Joined: Mon May 06, 2013 6:59 am
Location: Cape Town, South Africa

SUM partially working

Post by Mark HHP »

I have an object called BookList. Inside this object are three objects named: Regular, Feature and Book Extract. Each of this have a numerical size. BookList also has a field for Size, set to Number. I set the three into a group called Articles and used the following rule.

If BookList.Articles IS DEFINED Then BookList.Size = SUM Articles WHERE (Articles IN BookList.Articles)

Now the strange thing is that its working for some that I had made earlier but not for new BookLists. I can go into the old ones and edit an individual size and it reflects the change. But not in my new ones? Am I going crazy? What would allow it to work on one and not the other? All other elements are identical.
Mark
Running V5.7 (Build 1714) Linux Server. MySQL
weblike
Posts: 1165
Joined: Sun Dec 02, 2012 12:00 pm
Location: Europe

Re: SUM partially working

Post by weblike »

Waht if you use a "UPDATE Booklist" process?
Thx,
George
________________________________
Developer Edition
AwareIM: v8.5, build 2824
OS: Windows Server 2012
DB: MySql 5.6.42
Mark HHP
Posts: 387
Joined: Mon May 06, 2013 6:59 am
Location: Cape Town, South Africa

Re: SUM partially working

Post by Mark HHP »

I don't think that's the issue. If you make a change to the one, it updates live. But the other object you can save until you're blue in the face and it won't update.
Mark
Running V5.7 (Build 1714) Linux Server. MySQL
Powerm
Posts: 476
Joined: Mon Feb 01, 2010 9:44 pm

Re: SUM partially working

Post by Powerm »

You have few options for that:

- update every morning using Scheduler
- update when a BO is deleted or changed using a Rule
- update using a Process which runs every X seconds
Independent Developer
Mark HHP
Posts: 387
Joined: Mon May 06, 2013 6:59 am
Location: Cape Town, South Africa

Re: SUM partially working

Post by Mark HHP »

OK my fix was:

changing If BookList.Articles IS DEFINED Then BookList.Size = SUM Articles WHERE (Articles IN BookList.Articles)

to

BookList.Size = SUM Articles WHERE (Articles IN BookList.Articles)

That seems to do the trick. Strange that it was working previously
Mark
Running V5.7 (Build 1714) Linux Server. MySQL
Powerm
Posts: 476
Joined: Mon Feb 01, 2010 9:44 pm

Re: SUM partially working

Post by Powerm »

Correct, sometimes doing the calculation in two steps does not work properly.
Independent Developer
Post Reply