Overview:
Upon report creation the generated formatted output randomly shows an incorrect date on some pages in Vault.
Root Cause:
The date field is being populated using the field CurrentDate in the pdf on Master Page and not a vault object.
Solution:
The user should switch their template away from the default FormCalc script that comes with the out-of-the-box Current Date object and instead use a new Javascript script to populate the current date in the relevant fields.
The steps to do so are:
Add the existing Current Date field to the desired area. Click on that newly added field and bring up the Script Editor (Ctrl + Shift + F5) and replace the existing "$.rawValue = num2date(date(), DateFmt(1))" script with the following:
if ((this.resolveNode("$").rawValue == null || this.resolveNode("$").rawValue == "")) { var date = new Date(); var utcDate = new Date(date.getTime() + (date.getTimezoneOffset() * 60000)); this.resolveNode("$").rawValue = (utcDate.getMonth() + 1) + '/' + utcDate.getDate() + '/' + utcDate.getFullYear(); }
and change the Language away from FormCalc to Javascript.
An example of what it should look like is shown below:
Related Documentation:
Vault Help Documentation: N/A