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:

Avatar

Avatar
Level 1
TomBeesley
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
TomBeesley
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile
TomBeesley
Level 1

17-08-2017

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'

Accepted Solutions (0)

Answers (2)

Answers (2)

Avatar

Avatar
Level 1
TomBeesley
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
TomBeesley
Level 1

Likes

0 likes

Total Posts

6 posts

Correct Reply

0 solutions
View profile
TomBeesley
Level 1

21-08-2017

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

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct Reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

397 likes

Total Posts

2,687 posts

Correct Reply

492 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

17-08-2017

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;