KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: UUID for new entity creation time difference between local and client-server
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: March 19, 2024

When using ORDA .new() command to create new entities for a table, the UUID (as primary key) is actually created at different times depending on context. When running in single user mode, the UUID is created once entity.new() is called like so:

// Single-user example

$e:=ds.Table_1.new()
// $e.UUID is created here
$status:=$e.save()


For client-server, the UUID is actually created once entity.save() is called like so:

// Client-server example

$e:=ds.Table_1.new()
// $e.UUID is null here
$status:=$e.save()
// $e.UUID is created here


Keep this in mind when trying to use the UUID value in ORDA.