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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Make repeating subform readOnly


Level 2

My form has 8 pages. The first page has basic information including a dropdown list for months of the year. When the user selects the add month button, a new instance of the subform is repeated on the other 7 pages of the form. When a checkbox is selected to "close the month" the fields on all of the pages become read only.

My question is, if the user creates a new month before closing the first month, how can I make all of the fields read only when they go back to close the first month? Right now if they close the first month, then add another month, all of the fields become read only and works fine.

I thought to compare the months on the subforms and if they were equal, make the fields read only but I wasn't able to make that work using this code:

if (addRemSub.projectMonth.rawValue == page2.projectSub.addRemSub.projectMonth.rawValue)

xfa.resolveNode("page2.projectSub.projectMonthSub.projectTable").access = "readOnly";  //the projectTable can be repeated

I also tried comparing the index value of the subforms and if they were equal then lock the fields but that also didn't work.

Can anyone help me with this code?

1 Reply


Level 2

Nevermind. I got it to work with the help of the action builder.