Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Scrip Failed error shows in log file

Avatar

Former Community Member

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

9 Replies

Avatar

Level 10

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

Avatar

Former Community Member

I changed the operator as you suggested but still get the same error.

Avatar

Level 5

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

Avatar

Former Community Member

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

Avatar

Level 10

Hi Malcolm,

I never knew that there is an operator like !==. Thanks for the

information.

Nith

Avatar

Level 5

Hi Nith,

There is also === , again it compares the type before it compares the value.

Regards

Malcolm

Avatar

Level 10

Do you have any reference/manual that contains all these uncommon features?

Nith