3 Replies Latest reply on Jun 5, 2017 11:55 PM by JoeSand

    portal updating in a shared file


      I just ran across a problem that resulted in me accidentally overcharging a customer!  I have a Repair Order solution that has Repair Order records, and each repair order has a portal containing line items... same thing as the typical invoice solution.  The Repair Order then has calculation fields that sum up the line items... parts, labor, sales tax, total, etc. via their relationship.


      First, I've noticed that changing numbers in line items doesn't necessarily pass on to the totals, even after pressing "enter."  I can click in the individual fields causing them to update one at a time, or I can refresh the window.  Since this database is shared on a second computer, I watched what the other computer does when I modify a portal field, and find that all the totals update right away, but the computer I'm using doesn't!  I also found that if I delete a portal row on one computer it doesn't necessarily show on the shared computer until I make any change within the portal of this second computer. 


      Some of this behavior seem random, or at least I haven't discovered exactly how to duplicate all these things every time.  Any idea what's going on?  I thought that maybe my habit of using un-stored calculations might be at fault, but probably because I'm using sums of related fields in most of these calculation FM won't have it any other way.


      I'd hate to have to include a "refresh window" triggered by exiting every portal field (or at least the ones with numbers) ...

        • 1. Re: portal updating in a shared file

          I've tried some variations on refresh portal and refresh window, and have yet to find an answer, so here's a simpler question:

          How can I assure that ALL fields in a layout will correct for whatever other fields are changed, regardless of what kind of field they are, what their relationship is, or whether or not they are in a portal?  I have yet to find a technique that gaurantees that the totals I see at the bottom of my repair order are correct.  I charged a customer $216 too much because the totals didn't update when a line item was adjusted.

          • 2. Re: portal updating in a shared file

            Ah, discovered Commit Record/Request.  Might have found the answer as long as there's a script involved...

            • 3. Re: portal updating in a shared file

              So, if I have a script run "on object exit" for each numeric field in the portal, that invokes both Commit Record and Refresh Window, then the totals seem to track the changes to line items.

              So, NOW my question is, "is this really necessary?"  Am I missing something?  Shouldn't all my calculations naturally follow upstream changes simply by hitting "enter?"  Seems awkward and unnecessary to me...