Are you working with oracle forms or Oracle EBS ?
If Form then
First Create a Alert with the following properties and message to display
Alert_name is Test
In the when-button-pressed trigger write the code
IF :Block.your field_name(Empno) or :Block.Ename or :block.Sal is null then
Show_alert ('your alert_name');
Thanks & Regards
I am using Oracle Forms only...
My Problem is
If empno,ename,sal items are empty then ...
In alert message it should show
Sal fields are empty..
fill these items.
According to your code it will show only alert message but I want the item fields in the Block are displayed in the alert message.
it should dynamically or when i pressed button in form it should show the alert message with above items.
If required item fields 2 are empty then alert message should show the 2 item fields are empty...
if 3 then 3 items should be shown in alert message....
Do you want this option for learning yourself or for business (job) related.
Simple right click the field Empno and select 'Requried ->'Yes'.
Now your form will take care itself , and user cannot save record untill the supplies this filed. User also will get message at status bar.
In case , for learning purpose,
after alter message, after user selecting yes/no say 1 or 2,
If Alter_Answer =1 Then Message 'Alter Box yes selected';
Message(Alter Box NO is selected');
You can do code accordingly,.
1 person found this helpful
I tried this on EMP table.... Is it correct???????????
I write this code in WHEN-BUTTON-PRESSED
alrt2:='Enter These items'||chr(13)||chr(10);
if :emp.deptno is null then
if :emp.ename is null then
if :emp.sal is null then
if :dept.deptno is not null and :emp.ename is not null and :emp.sal is not null then
# Chr(10) returns a linefeed character
# Chr(13) returns a carriage return character
Other wise help me try to reduce the code.....
Thanks & Regards,
Your code works, but will hav a lot of work if you want to do that for every form of a bigger application. Any reason why you don't set the required-property of the items which are required? Then there would be no need for that coding.
Instead of Message I tried to display alert message....
In a normal website I saw that and I tried in Oracle Forms.
There is any chance to reduce the code....
Thanks & Regards,