SAP CAP Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
qmacro
Developer Advocate
Developer Advocate
851

In an earlier question in this challenge, we looked at the managed aspect in the context of common and reusable definitions. This aspect causes each entity to which it is assigned to gain four new elements thus:

createdAt  : Timestamp @cds.on.insert : $now;
createdBy  : User      @cds.on.insert : $user;
modifiedAt : Timestamp @cds.on.insert : $now  @cds.on.update : $now;
modifiedBy : User      @cds.on.insert : $user @cds.on.update : $user;

This is change tracking at a very simple level, and often is all that is required.

But when more capable change tracking facilities are needed, there is a plugin that can be employed, which provides out-of-the-box support for automated capturing, storing, and viewing of the change records of modelled entities.

All one has to do, beyond installing the plugin as a dependency, is to annotate the parts of the model for which we want to have changes tracked.

What is the name of the annotation?

This is a question from the June Developer Challenge on CAP Knowledge. And don't forget: always submit your answer as a hash, on its own - read the Taking part section of the intro post for more info. At the end of today, this question will be updated with links to further reading on this topic.

Further info:

26 Comments