Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Repeat date same as the repeating row above

Avatar

Level 9

I created a Travel Expense Report.

The user enters receipt information on each row.

They click a button to add another row and another receipt.

The first cell (Column A Row 1) is a auto-generated row number (1,2,3, etc...) based on the instanceManager count.

I would like to make this numbered cell a button that the user can click to add the same date they entered in the row above.

I know how to number it by using the caption, but cannot figure out how to do the rest of the script.

FormScreenPrint.JPG

1 Accepted Solution

Avatar

Correct answer by
Level 10

Assuming the row is named 'Row' and the date field 'DateField' the script in FormCalc will be:

DateField = Row[-1].DateField

In JavaScript it will be a bit more complex:

DateField.rawValue = Table.resolveNode("Row[" + (this.parent.index - 1) + "]").DateField.rawValue;

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Assuming the row is named 'Row' and the date field 'DateField' the script in FormCalc will be:

DateField = Row[-1].DateField

In JavaScript it will be a bit more complex:

DateField.rawValue = Table.resolveNode("Row[" + (this.parent.index - 1) + "]").DateField.rawValue;

Avatar

Level 9

Thank you for your help with this!