I'm tryint to write formcalc script to validate dates. Basically, based on a specific value in a drop-down field and today's date the date in the 3rd form can't be more than 2 weeks from today. This is what I've got so far. Where am I going wrong?
var DateTimeField1 = Num2Date(DateTimeField1, "MMM DD, YYYY")
var $ = Num2Date($, "MMM DD, YYYY")
if (OEDCode == "5" and HasValue($)) then
(Date2Num($ - DateTimeField1)) <= 14
else
$.rawValue = num2date(date(), DateFmt(2))
endif
Thanks.
I would not use the "$" symbol as a variable since it is used to identify the focused field.
George Kaiser