cancel
Showing results for 
Search instead for 
Did you mean: 

Need to Hide Subform if Date Field Value is before Hard Coded Date - AdobeLiveCycleDesigner Formcalc Help

Former Member
0 Kudos
246

So far I have this code:

if (date2num($formattedValue, "MM/DD/YYYY") lt date() - 0) then

data.Page2SCAForm.Presence = "hidden

endif

This means that if the date value if before today's date then hide the specified subform.

This isn't exactly what I need to do though -

Using FormCalc I want to hide a specified subform when the date field is less than a hard coded date (Say Jun20th 2014)

Playing with this I am able to get the code above in, but I get an error that the subform presence isn't accessable. (feel like that's a code issue using javascript vs formcalc) - Also need to know how to modify the above to compare to the hard coded date rather than the date2num date.

Assistance appreciated.

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

in the script editor I have done an initialization script on the Date field.

if ((this.resolveNode("$").rawValue < "05/27/2014"))

then

this.resolveNode("data.Page2Subform").presence = "hidden"

endif

still working...

this isn't working right... but it's more the idea what I am trying to do...

Florian
Active Contributor
0 Kudos

Hi Alicia,

I think this will help you out:

var currentNum = Date2Num(<whatever>.currentDate,"MM/DD/YYYY")

var oneNum = Date2Num($.rawValue,"YYYY-MM-DD")

if (oneNum <= currentNum) then

  xfa.host.messageBox("Date must be after current date")

endif

~Florian

Former Member
0 Kudos

I need to hide a subform when the request date is before a specifi date.

Not show a message box. thank you,

Florian
Active Contributor
0 Kudos

Ah Alicia,

nice one, Thought you face a problem with the if itself...

~Florian

nsikka
Active Participant
0 Kudos

You may check if TextField.Rawvalue ne space then you may hide that subform.

Former Member
0 Kudos

I need to hide the form when the request date is before a certain date.  Say all requests before May 27th for example.

I am also not certain if I need to specify a formatted date value when I do the comparison to the date field.

nsikka
Active Participant
0 Kudos

hi,

Is it that some field will have hard coded value for date?

Thanks,

Nitin

Former Member
0 Kudos

Yes.  A field - RequestDate will have the hidden field.

RequestDate is a field in a table in a subform.