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

Avatar

Avatar
Validate 1
Level 1
redbaron07
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
redbaron07
Level 1

Like

1 like

Total Posts

11 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
redbaron07
Level 1

08-08-2016

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!

Accepted Solutions (0)

Answers (0)