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
BedrockMission!

Learn more

View all

Sign in to view all badges

I'm getting a strange error with a simple action:

TomBeesley
Level 1
Level 1

Exception in line 7 of function top_level, script XFA:form1[0]:Page1[0]:DateTimeField1[0]:initialize.

The action is to set the date to todays date when it's initialized, i've done this countless times before but it doesn't seem to work today. Does anyone know why I'm getting this error?

This is the auto generated code:

//+ GENERATED - DO NOT EDIT (ID:443BB922-B5CF-4C2E-AC98-90E109B03150 CRC:1922439632)

//+ Type: Action

//+ Result1: SetFieldValue("$Node1","totoday","")

//+ Node1: form1[0].Page1[0].DateTimeField1[0]

//+ Condition1: DateField("$Node1","initialized","")

//+ ActionName: DateTimeField1.initialize

this.resolveNode("$").rawValue = util.printd("yyyy-mm-dd", new Date());

//-

I also get this error when the event is set to exited:

Invalid property get operation; subform doesn't have property 'prototype'

2 Replies
radzmar
Level 10
Level 10

The script is fine, maybe the JavaScript engine of your PDF viewer has crashed. Try to reboot your computer.

You also can type the script yourself, instead using the action generator. The result is a more compect code:

this.rawValue = this.isNull ? util.printd("yyyy-mm-dd", new Date()) : this.rawValue;
TomBeesley
Level 1
Level 1

Hmm I tried your script but it still doesn't seem to work. Other PDF's I've created since work ok with dates so I'll create the form again.

Cheers