Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Javascript warning error in error.log file

Avatar

Level 2

Hi all,

 

I am using Output service to generate DOR using XDP templates. I see below warning in the error.log file although my DOR is generated without any issues. The language selected in javascript and it runs at client side.the event is formReady.

below is the log file entry.

 

I have two questions:

 

1. It complains of a null value being assigned to some object, however i have alert all possible values that are calculated and none seem to be null.  This piece of script works and data is populated in the XDP layout/PDF as per the script logic. How do i debug this to understand the line that causes this?

 

2. Is there a way to hide these warnings in the error.log and only print the actual errors, instead of these warnings.

 

Regards,

 

14.12.2022 20:07:35.954 *WARN* [RequestProcessor-1] com.adobe.document.XMLFormService ALC-XTG-032-108: [16422] Script failed (language is javascript; context is xfa[0].form[0].MedAsstRoot[0].PrimaryContact[0].Person[0].Relationship[0])
script=var numOfRelationships = this.instanceManager.count;
 var oIndex = 0;
 var numOfInstances = Step3.resolveNode("relationships[" + oIndex + "]").householdMember.body.relationshipTo.instanceManager.count;

 for(var i = numOfInstances; i < numOfRelationships; i++) {
  Step3.resolveNode("relationships[" + oIndex + "]").householdMember.body.relationshipTo.instanceManager.addInstance();
}

var relIndex = this.index;
var oRelationship = Step3.resolveNode("relationships[" + oIndex + "]").householdMember.body.resolveNode("relationshipTo[" + relIndex + "]");
oRelationship.relationshipType.rawValue = RelationShipTypeCode.rawValue;

// find the matching contactID
if (PrimaryContact.Person.ContactId.rawValue === RelatedContactID.rawValue) {
  oRelationship.memberName.rawValue = PrimaryContact.Person.NameSF.FirstNameSF.firstName.rawValue + " " + PrimaryContact.Person.NameSF.LastNameSF.lastName.rawValue;
  oRelationship.memberIndex.rawValue = 1;
}

var numPersons = this.resolveNode("Person").instanceManager.count;
for (i = 0; i < numPersons; i++) {
 var oPerson = this.parent.parent.parent.Step2Person2.resolveNode("Person[" + i + "]");
 
 if(oPerson.HiddenSF.ContactId.rawValue === RelatedContactID.rawValue) {
   oRelationship.memberName.rawValue = oPerson.P.Table1.Row1.firstNameSF.firstName.rawValue + " " + oPerson.P.Table1.Row1.lastNameSF.lastName.rawValue ;
 }
}
14.12.2022 20:07:35.955 *WARN* [RequestProcessor-1] com.adobe.document.XMLFormService ALC-XTG-032-275: [16422] Error: null is not an object

 

0 Replies