4D v16.3

Is new record

Home

 
4D v16.3
Is new record

Is new record 


 

Is new record {( aTable )} -> Function result 
Parameter Type   Description
aTable  Table in Table of the record to examine or Default table if this parameter is omitted
Function result  Boolean in True if the record is being created, False otherwise

The Is new record command returns True when aTable’s current record is being created and has not yet been saved in the current process.

Compatibility Note: You can obtain the same information by using the existing Record number command, and by testing if it returns -3.
However, we strongly advise you to use Is new record instead of Record number in this case. In fact, the Is new record command ensures compatibility with future versions of 4D.

4D Server: This command returns a different result for the On Validate form event depending on whether it is executed on 4D in local mode or 4D in remote mode. In local mode, the command returns False (the record is considered as already created). In remote mode, the command returns True because, in this case, the record is already created on the server but the information has not yet been sent to the client.

Example  

The following two statements are identical. The second one is strongly advised so that the code will be compatible with future versions of 4D:

 If(Record number([Table])=-3) `Not advised
  ` ...
 End if
 
 If(Is new record([Table])) `Strongly advised
  ` ...
 End if



See also 

Modified record
Record number

 
PROPERTIES 

Product: 4D
Theme: Records
Number: 668

This command can be run in preemptive processesDifferent in remote mode

 
HISTORY 

Created: 4D v6.5

 
ARTICLE USAGE

4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)