1.5.7 Validation Rule
This topic describes how to define the validation rule.
This is the PL/SQL validation code based on which the system will check the value of the new field and validates at the time of transaction processing. Entry to this field is mandatory if you have checked against ‘Validation Allowed’.
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 the 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.
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 UDF is linked to FUNCTION_ID: To use (@Record_key) in UDFs’ where Usage allowed is ‘Function_id’ you have to maintain Function Key Mapping, which will be used to determine the record key before you define the UDF.
Parent topic: Date Field