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

util.scand returns null

Avatar

Level 1

Hi,

I am facing weird situation. There is one dynamic PDF created using LiveCysle designer 8.5 and used by many users.

I have used one of line code: var recDate = util.scand("mm/dd/yyyy', Page1.ReceivedDate.formattedValue);

This line returns NULL for one user but working fine for rest of the users. All are using the same PDF.

See the below screen print:

untitled.JPG

Page1.ReceivedDate.formattedValue is:

untitled.JPG

When I use the same PDF on my machine, I see ( here I have used different date, if I give the same date result be in the same format 😞

Please advise why there are two ouputs for same line of code.Capture.JPG

2 Replies

Avatar

Level 1

Hi

As your parameter passed to util.scand is  "mm/dd/yyyy', so your "Page1.ReceivedDate.formattedValue" should be  "06/25/2014"  i.e. length should be same as string (mmddyyy).

Avatar

Level 10

Hi,

It would seem the ReceivedDate field is set to use the system default locale on the Field tab, so is dependent on the user settings.  You might want to change your code to use the rawValue property which is not dependent on the locale by defined by the data pattern for the field, which defaults to yyyy-mm-dd.

Regards

Bruce