cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Nintex Newbie

Multiple Validation Rules for Forms with Repeating Sections

I hope this post isn't too confusing. I'm including screen shots with markups to help explain what it is I'm trying to do...

 

I have a form with a main "Parent" section. Below is a repeating section with "child" fields. The "Parent" section has a "Parent TSR" and "Parent TCR" field (currency values). These values can remain $0 if there is only ONE child in the repeating section. However, if a user clicks "Add New Row," then the "Parent TCR/TSR" would become required to be greater than $0.00. 

 

The validation rules I have set up on the "Parent TCR/TSR" fields are that if the total "Child Rows (repeating section)" is greater than 1, then the "Parent TCR/TSR" must be GREATER than $0.00. If there is only ONE row (no additional rows in the repeating section), then the "Parent TCR/TSR" is not required to be greater than $0.00.

 

BUT...

 

For each child row, the "Child TCR/TSR" cannot be treater than the "Parent TCR/TSR" if there is more than ONE child row. The combined sum of the children TCR/TSR can be greater than the "Parent TCR/TSR", but NOT individually.

 

SO...

 

If the "Parent TCR/TSR" is $50.00 / $50.00, then each individual child row cannot be greater than $50.00. 

 

The validation rule needts to state something like, if the total number of child rows is greater than 1, then the INDIVIDUAL child TCR/TSR cannot be greater than the parent TCR/TSR. HOWEVER, if the total number of child rows is only 1, then the Parent TCR/TSR can be $0.00 and the child TCR/TSR can be whatever it wants, so it CAN be greater than $0.00 without throwing a validation rule.

 

I know this is confusing... I'll try to show you in screen shots.

 

 

 

 

Labels: (1)
0 Kudos
Reply
1 Reply
Highlighted
Nintex Newbie

Re: Multiple Validation Rules for Forms with Repeating Sections

SharePoint on premises has a runtime function called currentRowNumber(countrol_in_repeating_section). This returns the current row number that the control in the repeating section has.

So the two rules could be something like the following:
if currentRowNumber(childTCRTSR)>1 and childTCRTSR>parentTCRTSR then raise error
if currentRowNumber(childTCRTSR)=1 and parentTCRTSR>0 and childTCRTSR>parentTCRTSR then raise error
Reply