Home » Developer & Programmer » Forms » check date (Oracle form 9i)
check date [message #387931] Sat, 21 February 2009 23:02 Go to next message
Messages: 41
Registered: December 2008
Location: U.A.E
i have table include (year, begin_date, end_date) and i want to write code that when i want to write new year in the new row in my form that give me error when end_date > begin_date( my form is tabular), so i worte this one

max_year varchar2(5);
select max(nyayear_year)
into max_year
from nyayear;

select distinct 1 into :global.dummy
from nyayear
where :nyayear_begin_date < (select nyayear_end_date
from nyayear
where nyayear_year = max_year);

message ('*ERROR* Invalid Evaluation Begin Date; Date should be greater than'||' '||:w_end_date||'.');
raise form_trigger_failure;

exception when no_data_found then null;

max_year give me 2009

select nyayear_end_date
from nyayear
where nyayear_year = max_year give me 18-2-2009

when i go to the last row and i click " F4" to copy last row, so last row come to my new row, then i worte this code in YEAR field (when_validate_item) ..it give me the error when i write end_date begger than begin_date ....but the problem is the pointer stick in the YEAR feild and i want it to go to begin year so i can change it.
thank you so much for your help
Re: check date [message #387938 is a reply to message #387931] Sun, 22 February 2009 00:47 Go to previous message
Messages: 20847
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
So, you are happy with the code, but you'd just want to position a cursor into another item. Right? If so, would
message ('*ERROR* Invalid Evaluation Begin Date; Date should be greater than'
          ||' '||:w_end_date||'.'
go_item('item name you'd like to set focus to');                --> this line
raise form_trigger_failure;
Previous Topic: How can i UnInstall D2K ?
Next Topic: Import *.TXT data into Oracle Form
Goto Forum:

Current Time: Thu Oct 20 14:43:47 CDT 2016

Total time taken to generate the page: 0.10145 seconds