Hello,
The below error keeps showing in the log file every time the form is launched even though the script works fine.
[12/9/11 8:23:10:493 CST] 00000077 XMLFormServic W com.adobe.service.ProcessResource$ManagerImpl log ALC-XTG-029-292: [1768] Script failed (language is javascript; context is xfa[0].form[0].form1[0].Wellness_Page1[0].DestructionDate[0])
script=
var d1 = util.scand("mm/dd/yyyy", CurrentDate.rawValue);
if (d1 !== null)
{
d1.setFullYear(d1.getFullYear()+1);
DestructionDate.rawValue = util.printd("mm/dd/yyyy", d1);
}
Can any one please advise on how to fix it. It shows both in ES and ES 2.
Thanks, Han
Views
Replies
Total Likes
The If expression is wrongly typed as if (d1 !== null)
Note that the logic operator is wrong.
Try the following expression:
if (d1 != null)
Nith
Views
Replies
Total Likes
I changed the operator as you suggested but still get the same error.
Views
Replies
Total Likes
Hi
There is nothing wrong with the if statement, the !== just means that it will check type of the objects before comparing values.
Can you upload the file to acrobat.com or some other sharing site and provide a link here so that we can investigate the file?
Regards
Malcolm
Views
Replies
Total Likes
Hi Malcolm,
If I change the script for "Run At" to "Client" instead of "Client and Server" then the error does not show in the log file and it seems to work the same.
Han
Views
Replies
Total Likes
Hi Malcolm,
I never knew that there is an operator like !==. Thanks for the
information.
Nith
Views
Replies
Total Likes
Hi Nith,
There is also === , again it compares the type before it compares the value.
Regards
Malcolm
Views
Replies
Total Likes
Do you have any reference/manual that contains all these uncommon features?
Nith
Views
Replies
Total Likes
Hi,
this is documented in the ECMA Script manual.
http://www.ecma-international.org/publications/standards/Ecma-262.htm
Views
Replies
Total Likes
Thank you so much!
Nith
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies