Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CDS Defaults in Type

I have a type declared in CDS like:

   type AuditT {

        CreatedBy : sMedDesc;

        CreatedDt : UTCDateTime;

        UpdatedBy : sMedDesc;

        UpdatedDt : UTCDateTime;


I want to set default date to CreatedDt as current datetime so that when a record is inserted if no value is passed, it should insert with default current datetime?

Any idea?

Also is there a way to specify a sequence to specific column so that on each insert it increments the value based on sequence.

I can not find these features in CDS.

Appreciate your thoughts.


Naresh G

Not what you were looking for? View more on this topic or Ask a question