AnsweredAssumed Answered

Summing portal records before they are committed.

Question asked by srzuch on Nov 27, 2015
Latest reply on Dec 2, 2015 by srzuch

I have had inconsistent results using the aggregate function SUM on child records in a portal, before they are committed.  The SUM field on the screen displays the correct result, but the field in the Data Viewer does not reflect changes until the records are committed (and the Data Viewer window is refreshed).  I have an un-stored aggregation calculation field that shows the correct result on the screen, but an incorrect result in the Data Viewer.

 

Other users have reported this issue.

 

I need to be able to validate the total of the portal records before the records are committed.  The validation tests would be in the OnRecordCommit layout script trigger.

 

What is interesting is when I select the parent record SUM field, the value will change to the the incorrect value, but change back to the correct value when I leave the field.

 

Also, the LIST aggregate function works correctly; all amounts are properly reflected before the records are committed.

 

So, I am trying to obtain a better understanding in what is happening beneath the hood.  It appears that there are temporary values being stored, which can be differ from the actual values in the database (clearly, since the records are uncommitted). The LIST function accesses these temporary values, as does the SUM function for display purposes.  But the SUM function “data” field does not, so I can’t test the value.

 

The Invoice starter solution appears to work properly; the results of the SUM function reflects uncommitted records, and the SUM field properly shows up in the Data Viewer and can be validated in the OnRecordCommit script.  For the life of me, I can’t see what the solution is doing to get this to work right!

 

I am working with FileMaker Pro Advance version 13.0v5, under Mac OS X Yosemite (v10.10.5), with plenty of RAM (16gb).  The testing is performed on a single, non-shared database, stored on my local disk.  I have created several test databases from scratch, all behaving the same way.

 

This problem is an issue for me given the accounting/finance nature of the solutions that I am trying to develop.

 

Thanks for any information.

 

Steven

(new in FM, old in everything else)

Outcomes