Search code examples
c1-cms

How to add a timestamp field using Composite C1?


How can I add ChangeDate field to a global datatype in data perspective? I can add CreateDate field easily but stuck at record modification time.

This is how I add CreateDate field:

  • Just add a new field and rename it as CreateDate, type is Date

2014-04-26 00-52-36 C1  localhost - Google Chrome.png

  • In the advanced tab; remove widget and set default value as function Now.

2014-04-26 00-54-03 Ekran görüntüsü.png

Can I add another field which one keeps the modification date automatically, if any?


Solution

  • From: burningice

    There is a package for it here which you can use to enable ChangeHistory on dynamic types https://bitbucket.org/burningice/compositec1contrib/src/8f53d846304f4dea942b9169481ea3e53580804e/ChangeHistory/?at=default

    For static types, just make sure to inherit the Composite.Core.Types.IChangeHistory interface. Read the full discussion online.