Today, Business requirements are such that sometimes there is requirement to create certain complex validations which are really hard to achieve. For example, consider a requirement where the following expression is required:
IF (Account Group.Name = “0003”, Payment Terms Type.Name=”0001″)
It seems like easy validation but actually it is not as Account Group is a field of Type Lookup [Flat] in main table whereas a Company Code Data is a field of Type Tuple(Multi-valued) which is lookup to some Tuple Table in main table and this Tuple table has one of his member field as Payment Terms Type. So here Payment Terms Type is a member field of Type Lookup [Flat] inside a Tuple table. Now the Problem is through Validation tab, if you select main table then you would not able to select field Payment Terms Type while if you select Tuple table then you would not able to select Account Group as here you would only able to see all members of Tuple table not main table fields.
So the question: Is there any solution to this?
Yes, this can be achieved using Validation Group which is really handy in such situations since we can use Validation Group across tables.
Validation Group : Each validation group is a set of validations that can be conveniently executed as a group with a single selection rather than forcing you to run each individual validation separately.
Lets see the below procedure how can we work with it.
In validations Tab, right click->Edit Validations Groups as shown in below screen-shot.
Now give a validation Group name say IF(AG=”0003″, PYT=”0001″) as shown in below screen-shot.
Now select the main table, create a validation and assign this validation group created above in Group Property as shown below.
Main table validation
Tuple Table Validation
Now in record mode of data Manager, there are three records as shown below:
Record ID Account Group Payment Terms Type (inside lookup multi-valued Tuple field company code)
1 0003 0001
2 ZEXT 0001
3 0003 0002
In Record mode, Select all these three records–>Right Click–>Validations–>Execute Group–>IF(AG=”0003″, PYT=”0001″) as shown below.
So validations for which both Account Group and Payment Terms Type are true that is valid record. Thus only Record ID 1 is a valid record because we have to consider here TRUE (tick) for both validations as shown below.
So this is one aspect of Validation Group which can be used effectively in such validation requirements.