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

Locking a calculated date field

Avatar

Not applicable
I have a date field on my form using the custom current date object included in Designer 8.2, which applies the following FormCalc script to the LayoutReady event of the field:



// Current Date in short-style date format.



$.rawValue = num2date(date(), DateFmt(1))



My problem is this: the date is set when the user fills out the form, as expected. However, whenever the form is subsequently opened, the date is updated to the current date. I need to have the field set initially when the user fills out and submits the form, and then make it static so that future reviews of the form show the initial date. I know this is probably something very simple, but I am missing it. Any suggestions?



Thanks in advance,

Angie
1 Reply

Avatar

Level 10
I found this script the other day that seems to do the trick:



if ($.rawValue==null)then

$.rawValue = [put your script here]

else $.rawValue

endif

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now