These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Fill in the date based on another date field

jaspoe
Registered: Mar 31 2010
Posts: 14
Answered

Hi all,
I've got a date field called 'Submitted Date' being automatically filled in with this FormCalc:

if ($.rawValue == null) then

$.rawValue = num2date(date(), "MM/DD/YYYY")

endif

And I've got another date field called 'Modified Date'. Once I save the PDF, I have the 'Submitted Date' filled in and the 'Modified Date' blank. If I open it again to edit, I would like the 'Modified Date' to fill in if the 'Submitted Date' is not null. I'm having issues figuring it out, I'm brand new to LCD. I've searched for anything that looks like this, but haven't come up with much. Any help is greatly appreciated!

Thanks!

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Use this FormCalc in the calculate:event of the Modified Date field.

if (SubmitDateField.rawValue == null) then$.rawValue = ""elseNum2Date(Date2Num(SubmitDateField.formattedValue, "MM/DD/YYYY")  + 7, "MM/DD/YYYY")endif

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

jaspoe
Registered: Mar 31 2010
Posts: 14
Hi radzmar, I think this code will work good. I've taken it and modified it a bit, see below. I think this will work best! Thanks!

var d=num2date(date(), "MM/DD/YYYY")
if (SubmittedDate.rawValue == d) then
$.rawValue = ""
else
//Num2Date(Date2Num(SubmittedDate.formattedValue, "MM/DD/YYYY") + 7, "MM/DD/YYYY")
$.rawValue = d
endif