Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Livecycle designer - script for traversing a node

Avatar

Avatar
Level 1
priyankjain15
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
priyankjain15
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
priyankjain15
Level 1

22-07-2020

Hello,

 

I have a form (SAP) which I am designing in livecycle designer. I have the code below for one of the fields in the form. My requirement is to traverse a list of dates in a node and choose the latest one. The below code is only for test purpose. 

 

My expectation is that after the code is executed, I expect that the field should have the value from the last node traversed. In my example, there are two rows of data and I guess the field should finally have the value from the second row. This however is not happening. The field (this.rawValue) keeps the first value itself. Once this works, of course, I will refine it further for date comparison. 

 

******************************************************

Form.bdyMain.frmFreeTextBlock.performanceperiod.EndDate::initialize - (JavaScript, client)

var oDataItems = xfa.resolveNodes("Form.bdyMain.frmTableBlock_JournalEntries.frmServiceJournalEntries.tblServiceJournalEntries.frmJustForOuterTableBorder.tblSubTotal.secSubTotal.tblSubSubTotal.rowSubTotalItem[*]");

 

var enddate;

 

for ( i=0 ; i < oDataItems.length ;i++ )
{

 

var finalnode = xfa.resolveNode("Form.bdyMain.frmTableBlock_JournalEntries.frmServiceJournalEntries.tblServiceJournalEntries.frmJustForOuterTableBorder.tblSubTotal.secSubTotal.tblSubSubTotal.rowSubTotalItem[" + i + "].colDate");

 

enddate = finalnode.rawValue;

}

this.rawValue = enddate;

 

******************************************************

 

The hierarchy view of the form looks like in the attached image. 
hierarchy view.JPG

 

The second issue that i see is that the "oDataItems.length" returns "1" even when my data has two rows of data. 

 

Can someone help me understand where I might be going wrong?

 

 
 

 

Accepted Solutions (0)

Answers (0)