util.printd is not present in livecycle? | Community
Skip to main content
Level 2
July 15, 2021
Solved

util.printd is not present in livecycle?

  • July 15, 2021
  • 1 reply
  • 1355 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Kosta_Prokopiu1

@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.

 

1 reply

Kosta_Prokopiu1
Adobe Employee
Kosta_Prokopiu1Adobe EmployeeAccepted solution
Adobe Employee
July 15, 2021

@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.

 

AmiAdobeAuthor
Level 2
July 15, 2021
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