Base object attributes

All objects in the system should have a few base attributes:

Attribute

Data Type

Default Value

Notes

CreatedDateTime

DateTime

 

Only set once upon record creation, immutable

CreatedByUserId

Ref: user

 

Only set once upon record creation, immutable

lastModifiedDateTime

DateTime

 

Updated any time an update is performed on a record

lastModifiedUserId

Ref: user

 

Updated any time an update is performed on a record

deleted

Boolean

false

Deleted records shouldn’t be displayed on the front-end

For objects that implement tasks, they should also have the following attributes:

Attribute

Data Type

Default Value

Notes

OwnerUserId

Ref: User

null

The user that created the task

AssigneeUserId

Ref: User

null

The user that is assigned to the task

When creating new tables, they should have the above attributes. For migrating existing tables to this new format the initial CreatedDateTime and lastModifiedDateTime should be set to 1/1/2000. CreatedByUserId and lastModifiedUserId should be set to a default System user.

Most controllers can be updated via baseController, but some controllers do not extend it and would need special attention. Some upserts using graphs (Sale) may update several tables at a time which could introduce some complexity.