1.5.7 Validation Rule
This is the PL/SQL validation code based on which the system check the value of the new field and validates at the time of transaction processing. Entry to this field is mandatory if you have selected Validation Allowed option.
For example, at the time of processing a contract for a customer, the bank wants to add a new field to enter the first nominee that the customer has specified in his account. The names of the nominees of a customer are maintained in the Customer Accounts Maintenance screen. The bank wants the system to check that the name of the nominee that is entered in the new field and the name of the first nominee that is maintained in the Customer Accounts Maintenance screen are same.
- Create a new user defined field of type Text,
- Specify Usage Allowed as Product,
- Check against Validation Allowed, and
- Write a code to validate the value entered in the new field. In the Validation Rule, you write a code to check that the value of the first nominee specified in the Customer Accounts Maintenance screen for the customer for whom you are processing a contract and the value entered at the time of processing a contract are same.
Syntax to be used in Derivation and Validation Rules
- (@FIELD_VAL)
(@FIELD_VAL) holds the Value UDF. This is s mandatory for Derivation Logic and it can be used in Validation logic to get the value of the field.
For example, (@FIELD_VAL): = ‘USD’;
Select ccy_code into (@FIELD_VAL) from CYTMS_CCY_DEFN where country = USA;
- (@RECORD_KEY)
(@RECORD_KEY) behaves differently for UDFs’ linked to Product and different for UDFs’ linked to Function Id.
(@RECORD_KEY)
When User Defined Field is linked to FUNCTION_IDTo use (@Record_key) in User Defined Fields where Usage allowed is Function_Id, you have to maintain Function Key Mapping, which is used to determine the record key before you define the UDF.
Parent topic: Date Field