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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

util.printd is not present in livecycle?

AmiAdobe
Level 2
Level 2

Hello, i'm trying to adapt some old script in an xdp document.

While previewing a document that should display a date in livecycle designer works well,

 

this code doesn't work in HTML mode:

 

myDate=util.printd("dd/mm/yyyy",new Date());
this.rawValue=myDate;

trying to catch the error i get: "referenceError: util is not defined"

 

How can i solve this?

 

Thank you very much

1 Accepted Solution
Kosta_Prokopiu1
Correct answer by
Employee
Employee

@AmiAdobe 

this seems to come from some external library. I am not aware that printd is supported by the XFA scripting in JS.

In FormCalc you have the DateFmt() function which would do what you want - and you could use picture clauses for your fields.

If "this" is a DateField you can set the formatting to match what you want without scripting.

Kosta_Prokopiu1_0-1626359095631.png

 

View solution in original post

0 Replies
Kosta_Prokopiu1
Correct answer by
Employee
Employee

@AmiAdobe 

this seems to come from some external library. I am not aware that printd is supported by the XFA scripting in JS.

In FormCalc you have the DateFmt() function which would do what you want - and you could use picture clauses for your fields.

If "this" is a DateField you can set the formatting to match what you want without scripting.

Kosta_Prokopiu1_0-1626359095631.png

 

View solution in original post

AmiAdobe
Level 2
Level 2
Sorry, i marked as correct reply. It's true, but i cannot modify the original layout and field of the xdp. I need another way to use util.printd and util.scand cause both are extensively used in the xdp
Kosta_Prokopiu1
Employee
Employee
I can only assume that the XDPs contain a script object named util where the printd function is written as a JavaScript function. Can you see it? Usually at the bottom.