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.

Locking a calculated date field

Avatar

Former Community Member
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