Expand my Community achievements bar.

SOLVED

AEM forms Designer , javascript errors in log file.

Avatar

Level 3

Hi All, 

 

I am getting below errors in the error.log file.

I am using AEM 6.5 and Output service to create DOR . The script in question is written with language as javascript, and run at client side and event is form ready. The script  logic runs fine and the PDF is created with data populated as per the script written.

 

I have two questions regarding the same.

 

1. The warning message complains of a null object. I have app.alert all possible values that are calculated and didnt see any null values, how can i debug this further? Any suggestions are welcome.

2. Is there a way to remove these warnings from error.log file? Are there any settings that i can use to only print the errors only in the error.log file and not the warning message

 

 

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
1 Accepted Solution

Avatar

Correct answer by
Employee Advisor
1 Reply

Avatar

Correct answer by
Employee Advisor