Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Problems using Time2Num() to create unique identifier

Avatar

Level 1

I am a casual user of LiveCycle (v8.0) and am trying to create a field that will generate a unique value using the Time2Num function, calculating from the time the form is opened.  I found some code online, but can only get it to work when the time is hard coded (below).  The field type is Date/Time.  I was trying to insert 'Time()' in place of the "13:13:13" with the same format, different formats, no format, but the field only shows a zero when opened.  Not sure if I'm using the wrong field type, code, or both?

Thanks.

<event activity="ready" ref="$layout">

<script>

if ($.rawValue == null) then

$.rawValue = Time2Num("13:13:13", "HH:MM:SS")

endif

</script>

</event>

2 Replies

Avatar

Level 10

You do not need aconversion. You can directly use the Time() function..

if ($.rawValue == null) then
$.rawValue = Time();
endif

Thanks

Srini