Hi Tom,

I suppose the problem is that you are copying the reference of your 
preference_object WP to [invoices] and not the wp content itself.
This way ST Freeze is also modifying your original WP and in the next run of 
the loop there are no more references to be freezed.

Afterwards your preferences object is probably not being saved, so won't notice 
the [preferences] record was modified.

Could you try changing this line
        [Invoice]Invoice_WP:=[Preferences]Preference_Object
to this:
        [Invoice]Invoice_WP:=ob copy([Preferences]Preference_Object)

HTH
Koen

> Op 13 feb. 2019, om 18:34 heeft Tom Dillon via 4D_Tech <4d_tech@lists.4d.com> 
> het volgende geschreven:
> 
> The first time through, the [Invoice] record has all the correct references 
> resolved. The second time through, even though the fields being referred to 
> have changed, the saved WP object field contains a copy of the same field 
> from the first one.
> 
> Basically this for a selection of [Client] records:
> 
> For ($Ndx;1;Records in selection([Client])
> Create Record ([Invoice])     
> < load, calc and assign needed stuff >
> [Invoice]Invoice_WP:=[Preferences]Preference_Object
>       ST FREEZE EXPRESSIONS([Invoice]Invoice_WP)
>       SAVE RECORD([Invoice])
>       NEXT RECORD([Client])
> End for 
> 



--------------------
Compass bvba
Koen Van Hooreweghe
Kloosterstraat 65
9910 Aalter
Belgium
tel +32 495 511.653

**********************************************************************
4D Internet Users Group (4D iNUG)
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