Requirement: Let us assume, we have got an Oracle APEX page with an Interactive Grid in it.
The Interactive Grid will have data about the Employees.
In the Interactive Grid we have a column called Employment Type and the value of this column can either be Contractual or Permanent.
We have got another column called Variable Salary.
Now, when the value of the Employment Type column is Contractual, then the corresponding value in the Variable Salary is optional.
When the value of the Employment Type column is Permanent, then the corresponding value in the Variable Salary column is mandatory. In case the user has not provided any value of the Variable Salary column, immediately it should throw validation error for that particular row.
Sample output screen in shown below:
Solution: For solution of the above requirement follow the steps as shown below:
Step 1: Go to the Interactive Grid (Employee reports) > Right click on the VARIABLE_SALARY > Click Create Validation
Step 2: Set the following properties for the validation
- Name: conditional_mandatory_validation
- Validation Type: Column is NOT NULL
- Validation Column: VARIABLE_SALARY
- Type: Item = Value
- Item: EMPLOYMENT_TYPE
- Value: Permanent
- Execute Condition: For Each Row
Save all and run the application. And with that we can see the screen is working as per our expected requirement.
Hence, the solution to our requirement.
Thanks & Regards,
601 total views, 2 views today