Re: 4D Write Pro Brain Cramp

2019-02-13 Thread Tom Dillon via 4D_Tech
Koen Van Hooreweghe via 4D_Tech wrote:

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

I can feel the fog slowly lifting! Now I remember hearing that this is the way 
objects work. I have a LOT to learn about objects and the occasional kick in 
the butt to get me on the right track again.

Thanks Koen!

-- 
   --
   Tom Dillon  375 S Main St #405
   DataCraft   Moab, UT 84532
   tomdil...@datacraft-inc.com   720/209-6502
   --
  The butterfly will only land on you after you stop
  grabbing for it. --- Sunastar
   --


**
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
**

Re: 4D Write Pro Brain Cramp

2019-02-13 Thread Koen Van Hooreweghe via 4D_Tech
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
**

4D Write Pro Brain Cramp

2019-02-13 Thread Tom Dillon via 4D_Tech
I know I'm missing something about 4D Write Pro involving ST Freeze Expressions.

In a loop I create an [Invoice] record, assign an invoice template to the Write 
Pro object field
([Invoice]Invoice_WP:=[Preferences]Preference_Object)
Call ST FREEZE EXPRESSIONS([Invoice]Invoice_WP)
Save it.

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 


What am I missing?

Thanks y'all!

-- 
   --
   Tom Dillon  375 S Main St #405
   DataCraft   Moab, UT 84532
   tomdil...@datacraft-inc.com   720/209-6502
   --
Some people can
   justify anything.
   --- Sunastar
   --


**
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
**