This is the legacy 4D documentation web site. Documentations are progressively being moved to developer.4d.com |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v19.8
entity.reload( )
|
entity.reload () -> Result | ||||||||
Parameter | Type | Description | ||||||
Result | Object |
![]() |
Status object | |||||
The entity.reload( ) method reloads the content of the entity in memory, according to information stored in the table related to the dataclass in the datastore. The reload is done only if the entity still exists with the same primary key.
Result
The object returned by entity.reload( ) contains the following properties:
Property | Type | Description | |
success | boolean | True if the reload action is successful, False otherwise. | |
Available only in case of error: | |||
status(*) | number | Error code, see below | |
statusText(*) | text | Description of the error, see below |
(*) The following values can be returned in the status and statusText properties of Result object in case of error:
Constant | Value | Comment |
dk status entity does not exist anymore | 5 | The entity no longer exists in the data. This error can occur in the following cases:
Associated statusText: "Entity does not exist anymore" |
dk status serious error | 4 | A serious error is a low-level database error (e.g. duplicated key), a hardware error, etc. Associated statusText: "Other error" |
C_OBJECT($employee;$employees;$result)
$employees:=ds.Employee.query("lastName=:1";"Hollis")
$employee:=$employees[0]
$employee.firstName:="Mary"
$result:=$employee.reload()
Case of
:($result.success)
ALERT("Reload has been done")
:($result.status=dk status entity does not exist anymore)
ALERT("The entity has been dropped")
End case
Product: 4D
Theme: ORDA - Entity
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)