Hi Don,

A couple of thoughts. First, and I'm assuming this is running on 4D server,
I'm not a fan of opening a record for editing in a transaction when you
also manipulate other records. This example illustrates why - each record
you touch in becomes locked to the transaction if you change it and if the
user walks away from their workstation (or goes home) it's a real problem.
In such a case I prefer to set a semaphore for the record (eg.
"[table]_edit_[recordID]" ) to prevent anyone else from working with it and
then save the final changes.

Regardless of that I'd do this sort of calculation entirely in variables.
Just load all the record data into the arrays and manipulate those. When
you have a solution you can update the underlying records. For your items
you only need the id, and cost to identify it. Even if you need more I
think the 'cost' of loading that data into arrays is trivial compared to
manipulating the records directly.

On Fri, Feb 23, 2018 at 3:33 AM, Don Lapin via 4D_Tech <4d_tech@lists.4d.com
> wrote:

> Your ingredients are entered into a field-type listbox, on the entry form.
> You start a transaction (it happens to be layered - the transaction, that
> is - since the data entry form is already in a transaction). You calculate
> the ingredient amounts and their price extensions, and enter them into the
> the related fields. You use arrays to record the varying percent flour
> (5-95 percent), and the total cake cost at each percent flour. The arrays
> are your product, so to speak, for listing and graphing.
> Then you cancel the inner transaction.
> When I do this, I am left with the entry form displaying the last cake
> cost in the range. Even though the ingredients in the listbox look okay. In
> the trace window, it also displays the wrong cake cost, so I don't think
> it's just a redraw issue.
> It should be displaying the original cake price, before I ran any tests.

Kirk Brooks
San Francisco, CA

*We go vote - they go home*
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com

Reply via email to