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

Validating Dates Based on Previous Row

redbaron07
Level 2
Level 2

Have a dynamic table and am trying to validate the current row's date field (DateTimeField1 for i) against the previous row's date field (DateTimeField2 for i-1) and an event start date with a fixed field (PStart_Date). 

var rowCountY = this.resolveNodes("RowX[*]");

for (var i=0; i < rowCountY.length; i++)

{

if ((PBE.Page2.SubFormEcho.SubformCharlie.TableA.RowX.DateTimeField1.rawValue >= PBE.Page1.ProjectInfoSubform.Table3.Row3A.PStart_Date.rawValue) && (PBE.Page2.SubFormEcho.SubformCharlie.TableA.RowX.DateTimeField1.item(i).rawValue >= PBE.Page2.SubFormEcho.SubformCharlie.TableA.RowX.DateTimeField2.item(i-1).rawValue))

        {this.rawValue = this.rawValue

        }

else

{

xfa.host.messageBox("The check-in date must be greater than the previous check-out date and the check-in date cannot be before the event start date.";

this.rawValue = ""

xfa.host.setFocus(this)

}

}

Thanks in advance for any help!

0 Replies