Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

How to keep time from constantly updating

Avatar

Level 2

Hello! I am trying to capture the time stamp of when the user opens the file ONLY. I have the field set to capture the date, but I need to keep that time from continuously updating. Any help is greatly appreciated. Thank you in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee

See https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-questions/need-a-date-time-field-to...

and generally in the initialization event of your time field (and your date field too) put some logic that prevents update if the field is filled. The initial state of a field NOT being prefilled by data is null.

Something like

if ($ == null) then
    $.rawValue = Num2Time(Time(), "HH:MM:SS")
endif
Does the trick (Note: this is FormCalc and not Javascript as FomrCalc has better time/date support - but you could code in JS too, same princip)

Kosta_Prokopiu1_0-1617954636589.png

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee

See https://experienceleaguecommunities.adobe.com/t5/adobe-livecycle-questions/need-a-date-time-field-to...

and generally in the initialization event of your time field (and your date field too) put some logic that prevents update if the field is filled. The initial state of a field NOT being prefilled by data is null.

Something like

if ($ == null) then
    $.rawValue = Num2Time(Time(), "HH:MM:SS")
endif
Does the trick (Note: this is FormCalc and not Javascript as FomrCalc has better time/date support - but you could code in JS too, same princip)

Kosta_Prokopiu1_0-1617954636589.png

 

Avatar

Level 2
THANK YOU THANK YOU THANK YOU!! That worked perfectly!