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:
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.
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).
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.