Data Validation Functions for Nested and Sub Nested attributes

Question:

"If the DVF will be working separately at the Nested and Sub nested attribute level or only at the Attribute level".

 

Is Active-> Yes

  • We have discussed the issue where the DVF is working for the following condition,
LoyalityProgram.Tier, LoyalityProgram.RadissonRewardNumber exists and LoyalityProgram.IsActive is true, the validation should trigger if LoyalityProgram.TierEndDate is in the past (relative to the current date).

Is Active-> No

  • We have discussed the issue where the DVF is not working for the following condition,
LoyalityProgram.Tier, LoyalityProgram.RadissonRewardNumber exists and LoyalityProgram.IsActive is false, the validation should trigger if LoyalityProgram.TierEndDate is missing

 

 

Answer:

Yes, it will work.

We can have multiple error/warning DVFs on the same nested attributes and their sub-attributes. It will show all errors/warnings if the data fails against the DVF rules.

 

As there are multiple conditions on sub-attributes of a nested attribute, it is recommended to use inSameAttributeValue function.

Please refer to Understanding the Expression Attribute to learn about inSameAttributeValue function. 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.