This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
dataClass.new( )
|
dataClass.new () -> Result | ||||||||
Parameter | Type | Description | ||||||
Result | Entity |
![]() |
New entity matching the dataClass | |||||
The dataClass.new( ) method creates in memory and returns a new blank entity related to the dataClass.
The entity object is created in memory and is not saved in the database until the entity.save( ) method is called. If the entity is deleted before being saved, it cannot be recovered.
4D Server: In client-server, if the primary key of the corresponding table is auto-incremented, it will be calculated when the entity is saved on the server.
This example creates a new entity in the "Log" dataClass and records information in the info attribute:
C_OBJECT($entity)
$entity:=ds.Log.new() //create a reference
$entity.info:="New entry" //store some information
$entity.save() //save the entity
Product: 4D
Theme: ORDA - DataClass
Created: 4D v17
4D Language Reference ( 4D v19)
4D Language Reference ( 4D v19.1)
4D Language Reference ( 4D v19.4)
4D Language Reference ( 4D v19.5)
4D Language Reference ( 4D v19.6)
4D Language Reference ( 4D v19.7)
4D Language Reference ( 4D v19.8)