...modify the step ROUND .... by ExecuteSQL, and now works as before (v13).
Qty Total = Round ( Sum ( portal_B::qty ) ; 0)
What is the "SetField" call in the "script transfer" box?
You may need to add a commit record and or refresh portal to the end of your script.
Yes sorry Wim, It was my mistake in the graphic.
If ( Sum (portal_B::qty > 0) )
SetField [ Qty_Total ; Round ( Sum ( portal_B::qty ) ; 0) ]
SetField [ Qty_Total ; "" ]
Same question: There is no "SetField" function in FM, only a "Set Field" script step. If your SetField() is a custom function then we'd need to see what that one does.
Set Field [ Qty_Total ; Round ( Sum ( portal_B::qty ) ; 0) ]
Set Field [ Qty_Total ; "" ]
Hi, I assume you run that from network (client/host)
If that's the case, could you try to run the solution (or it's backup) locally and see if the problem still occurs
TRY in LOCAL
...in FM13 It worked perfect
(01) SCRIPT : TRANSFER ( Parameter : id, Qty )
- Set variable [ $aux ; Get (ScriptParameter) ]
- go object (portalB)
- Set field [ portal_B::id ; GetValue ($aux ; 1) ]
- Set field [ portal_B::Qty ; GetValue ($aux ; 2) ]
Run Script [ PUT Qty_Total ]
(02) SCRIPT : PUT Qty_Total
If ( Sum (portal_B::qty > 0) )
Set Field [ Qty_Total ; Round ( Sum ( portal_B::qty ) ; 0) ] ;
Set Field [ Qty_Total ; "" ] )
in FM14 v3 ERROR, the last record of the portal is not added
**** pulse the bottom transfer one by one (fast),... ¿ It may be a problem of: incompleteness script execution ?
- make sure you commit after the set field steps, in the same script (01).
Your pseudocode does not show any layout changes that might mess up.
- in script 2, set variable $TotalQty to Sum(portalB:.Qty), then "if" on it and round on it, it's more
efficient than evaluating twice a sum.
thank Siplus, (1) yes, ...everything can be optimized. I make sure to persist data before calculating the totals. (2) yes,...but I must evaluate the total, with each new QTY entered. I must run Sum () with each new entry to update the total. My problem is the difference between the results in FM13 and FM14, en FM is ok sum 900,... in fm14 error, sum 500 (sum row 1 and 2,... 3 not)
VIEW VIDEO https://community.filemaker.com/videos/1842 In FM13 the result is 400 In FM14 the result is 350 (ERROR) :
I think the point people are trying to make is this: in your script you set the Qty field of record 3 (in the portal) to 400, but until you commit record 3, Qty = 0 (what it was before you set it to 400). When you commit that record, Qty = 400. So commit the record, then add things up, then commit it again. That's the way it's supposed to work with transactions. What I don't understand is why it would have worked in FM 13.
Here's another video with the problem This shows clearly the problem.
( the problem is the "Qty TOTAL" ),
... in FM13 sum = 400
I think you may really have found a bug, I suggest you do a Test Solutions with the narrow scope of just that problem, and you submit it to FMI.
Doing so, you may find the cause or not, but at least FMI will be able to investigate.
If your test case doesn't show the wrong behavior, then it might be the health of your file.
There's no reasons result between 13 & 14 could be different. The cause don't even matter, same code should give same results.
Those kind of bugs are very serious and concerning because they're silent, you could end up having wrong reports and no one would notice.
So please submit it there
Report a Product Issue
Thanks Vincent, I have reported this issue on 2 occasions a FMI.
I think if the error exists, this is caused by opening the file for the first time ... in the new version.
Data Viewer shows that the value is not updated Sum (), after commit, ... continued on 115,000
Retrieving data ...