How do I: Create a trigger script to set a date/time field to now?

91 views
Skip to first unread message

Paku

unread,
May 22, 2025, 1:10:09 PM5/22/25
to mementodatabase
Hello. Been using Memento DB on mobile for a while now. How do I make a trigger script that will modify an entry's date/time field and set it to today and right now whenever one of its fields is modified, such as in an entry's card? Basically make a "last modified" field that auto updates.

Er Mo

unread,
May 22, 2025, 1:55:29 PM5/22/25
to mementodatabase
Hallo
Das Datum und Uhrzeit ist das selbe . Memento rechnet von 1.1.1970 00:00 die Vergangen Millisekunde und zeigt diese and Datum ( in Datumsfelt ) oder als Uhrzeit ( in Datum Uhrzeit ) an . Für das Aktuelle datum / Uhrzeit verwendt " Date.now() " . Also im Skript : entry().set("Datum",Date.now())

Hello
The date and time are the same. Memento calculates the elapsed milliseconds from 00:00 on January 1, 1970, and displays them as a date (in the date field) or as a time (in the date/time field). For the current date/time, use "Date.now()." So, in the script: entry().set("Date",Date.now())

Ernst

David Gilmore

unread,
May 22, 2025, 5:11:35 PM5/22/25
to mementodatabase
To add what ernst said, create a couple of triggers that trigger on "Before Create" or "After Create" and "Before Update or After Update", and in the trigger script, add that line from above.
Reply all
Reply to author
Forward
0 new messages