4 Replies Latest reply on Mar 4, 2011 7:45 PM by njem

    Summary field doesn't update when it should.

    njem

      Title

      Summary field doesn't update when it should.

      Post

       This is a data entry form in browse mode. A form based on the "Recipes" table (this is for a bakery to track costs). See the attached screenshot of relationships. This has a front end and back end and all tables are in the back end, and the relationships are defined in both the front and back end the same.

       "Cost" is an unstored calculation defined as Amount * (Ingredient price::price per bulk unit / Ingredient price::divider to min unit / Recipes::Yield). The Divider is to reduce the bulk cost down to the unit cost, so 5lb of flour costs $x and your going to use it in units of 1lb so the divider is 5. The Yield is how many loaves the recipe makes so we can get down to a cost per loaf. Finally, the field that doesn't update automatically, is "Total Cost" which is a summary total of "Cost", not checked as a running summary, summarize repetitions altogether (don't think that applies anyway).

       If I change the amount or the yield the cost of the item on the portal line updates correctly but the total cost doesn't until I move to another record and back. Even clicking outside the fields to force it to commit doesn't do it.

       I could probably make a script trigger for "on commit" but I'd rather understand when I should and shouldn't expect it to update and how to make it happen without having to script if I can. I saw references here to a window refresh script step so I made a button to execute that and it does it, but that's not a good solution. 

      A quirk of this thing is that if I'm on the amount or yield field and change it and immediately click outside fields then all updates as expected. If I change one of those fields and then tab to the next field, or even on to the next line in the portal, the line will change but the Total field doesn't. Even clicking outside fields won't do it then. Then I have to step to another record and back. Not sure if this should be considered a bug or not, but FM is behaving differently depending on the operator's sequence of steps, which doesn't seem right.

       FM 11.0v3 on Win7.

       

      recipe.png

        • 1. Re: Summary field doesn't update when it should.
          philmodjunk

          This is an on going screen refresh issue with a summary field from a related table. (I'm assuming the layout is based on Recipes here.)

          You can either use a script trigger with the OnObjectExit or OnObjectSave set on any field in the portal that is referenced in the calculation or you can use a calculation field defined in Recipes defined as Sum ( Recipe Ingredients::cost ).

          This last calculation field will update smoothly when the related cost total field will not. It is not the best option, however, if you use portal filtering to bring up different groups of records in the portal.

          • 2. Re: Summary field doesn't update when it should.
            njem

            I'm trying that and I get a question mark. I made a field in Recipes, unstored calculation defined as Sum(Recipe Ingredients::cost). I am not filtering what's in the portal. I put this field not in the portal but outside it. Tried both in the body and in the header. It just gives me a question mark. Do I need a subsummary section?

            • 3. Re: Summary field doesn't update when it should.
              philmodjunk

              What do you see in browse mode if you click into the field?

              One cause of the ? result is when the field is sized too narrow to display the number. If that's the case, when you click into the field, you'll see the field pop out larger and display the correct value. That in turn will confirm that you just need to resize the field to be wide enough to display the number and any currency formatting you may have specified.

              • 4. Re: Summary field doesn't update when it should.
                njem

                Yes, the calculated summary field in the Recipe table does it.

                I've been bitten by this before, that you format a number as currency and you would think currency would default to two decimal places, but unless you remember to turn that on it's curreny with 20 decimal places and then it doesn't fit in the field space.

                Thanks.