OverView

This document talks about how to add the JavaScript alert when the item value is changed. We are going to achieve this in oracle apex using the JavaScript API method isChanged().

JavaScript method isChanged(), compares the current value with the value at the time on page load, and if it finds a difference, then returns True else False.

Technologies and Tools Used

The following technologies have been used to achieve the expected output.

JavaScript

UseCase

Assume that we are having an employee registration form and employee details report. Using this employees can enter the new data and modify the existing data. while modifying the existing data. If they try to change the employee number means we need to alert them. This is the use case.

This document explains how to achieve this requirement.

Architecture

The following steps explain in detail,

Step 1:

Needs to create the dynamic action in the change of the item “EMPNO”.Create the true action as execute JavaScript and add the below JavaScript code.

if (apex.item(“P4_EMPNO”).isChanged()) {

apex.message.alert(‘You modified the Employee Number, please verify again!’);

}

Step 2:

We are going to execute this in the data modification. So, we need to create the report and needs to add the redirect link to the primary key column of the report.

ScreenShot

Output:

On change of the filed value, employee number in modification dynamic action will get executed.If data has been modified in the field means it will throw the JavaScript alert as below.

 

Recommended Posts

Start typing and press Enter to search