Skip to main content
Question

Multi-Field Multi-Row Validation

  • November 29, 2023
  • 1 reply
  • 39 views

I have a object that needs to be unique using a three-part key of ColumnA (int), ColumnB (DateTime), ColumnC (DateTime).  I understand that the row passed to FieldValidating and FieldUpdating do not contain actual row values, just the .NewValue for the field. 

I’d *like* to make the error occur on the last change to the row which causes the duplicate, but I’m not seeing a way to do this. 

What is the preferred way to do Multi-Field Cross-Row Validation?

1 reply

  • Author
  • Freshman II
  • 8 replies
  • November 29, 2023

I know about  [PXCheckUnique(Where = typeof(Where<EMPTimeSwipe.bAccountID, Equal<Current<EMPTimeSwipe.bAccountID>>, And<EMPTimeSwipe.swipeTime, Equal<Current<EMPTimeSwipe.swipeTime>>>>))]
 

The problem is a little more complex if the rule is that the swipeTime can’t be within 6 minutes of another swipe time for the same person on the same day.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings