IsNew is true but fields are not dirty...

Posts   
 
    
Posts: 27
Joined: 23-May-2006
# Posted on: 05-Jul-2006 08:08:56   

Is it correct that when the IsNew property is true on an Entity, it will NOT collect the correct information for the insert (not null fields) when those fields are not dirty?

Thanx Marc Jacobi

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 05-Jul-2006 08:13:31   

When saving an Entity, the changed fields only get saved (IsChanged = true). Otherwise a null or a database default value for the field is Inserted.

Posts: 27
Joined: 23-May-2006
# Posted on: 05-Jul-2006 08:55:20   

OK. Is this done to allow triggers to come up with missing values?

I was expecting Save to simply collect all fields necessary for the insert to succeed.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39928
Joined: 17-Aug-2003
# Posted on: 05-Jul-2006 09:14:33   

ObiwanJacobi wrote:

OK. Is this done to allow triggers to come up with missing values?

I was expecting Save to simply collect all fields necessary for the insert to succeed.

True, but all fields not in the list of fields in an INSERT statement get NULL inserted by a DB (or their default value)

Frans Bouma | Lead developer LLBLGen Pro