On Oct 31, 2017, at 9:17 PM, Keisuke Miyako via 4D_Tech <4d_tech@lists.4d.com> 
wrote:

> but objects are references, so it is possible to modify the field without 
> "touching" it.
> the object notation is one way to do that.
> but it is also possible using classic coding,
> whereby you obtain a reference to a sub object (OB Get),
> and modify that sub object.
> again, the "parent" object is not modified directly,
> so it is not updated with SAVE RECORD.

I just want to add my vote (for the nothing it counts) that it is preposterous 
that data in a field can be changed and not saved when calling SAVE RECORD. The 
the only function of SAVE RECORD is to save the data that has been changed, and 
how it was changed should be completely irrelevant. 

Maybe a better way to say this is “there should be no possible way to modify a 
field without ‘touching’ it”.


> to explicitly indicate that the object has been modified, just use the line
> 
> [myTable]myObjectField:=[myTable]myObjectField
> and you have total control of when to save the field,

[myTable]myObjectField.somekey:=“A new value”  

That looks pretty explicit to me.

$obj:=OB Get([myTable]myObjectField;”Communications”)
OB SET($obj;”Reminder3”;Current Date)

SAVE RECORD([myTable])

Since 4D prior to v16r4 does not support dot notation, an object field 
sub-object may have been modified that way. Does that also not save the changed 
data? According to the recent discussion on this topic, it must not save 
properly. 

The fact that there could even be any confusion on whether changed data would 
be saved is a problem.


> to me this sounds like a better deal than a blanket "save always" system (the 
> real sloppy design choice, in my opinion)

The only reason us 4D programmers would need to implement a blanket “save 
always” system like the SAVE RECORD wrapper Peter Bozek mentioned is because 4D 
is not doing the right thing and saving the changed data. The only other option 
is to make sure we do not use object fields because they are broken.


Jim Crate

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

Reply via email to