On Wed, Jun 13, 2018 at 3:26 AM, johnbdhPop via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> Thanks Cannon,
>
>         So maybe I want to use OB Copy when I load the record in an input
> form. That way I can make changes to the object without changing the object
> in the field. That way if the user cancels I don’t have to worry about the
> field.
>
>         When the user saves the record, should I use OB Copy to save the
> object back to the field, or does it really matter?
>
> John
>
>
No and no, imho.

As I understand it, object field contain "serialized" object - it means
object is stored in some internal data structures, you can imagine it is
stored as JSON text (which is not the case, but is OK to visualize how it
works.) When you load the record, object is created (in memory)  from that
representation and reference to it assigned to field. When you save the
record, the object in memory is serialized (converted to JSON) and saved to
disk.

It means, when the record is loaded, you can work with object field as any
object variable (they ay be some exception for the rule, but nothing comes
to my mind now.) There is no need to copy the object field and then copy
object back - what you want to achieve, 4D does transparently.


--

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