Monday, June 9, 2014

How to validate a parameter value using Special value set.

After selecting SPECIAL validation type go to edit then select validate in the list write the code as mentioned below. Below code is used to validate the value based on the other parameter value.


FND PLSQL 
"declare
 l_diff NUMBER := 0;
l_to_Date varchar2(30) := :!VALUE;
l_from_date varchar2(30) := ':$FLEX$.XXG_ACC_TRX_FROM_DATE.VALUE';
begin
if to_date(l_from_date)<to_date(l_to_date) then
l_diff := (to_date(l_to_date) - to_date(l_from_date));
if l_diff > 35 then
   fnd_message.set_name( 'FND', 'FND_GENERIC_MESSAGE' ) ;
fnd_message.set_token( 'MESSAGE', 'Date Range Exceeded 35 days.' );
fnd_message.raise_error ;
end if;
else
fnd_message.set_name( 'FND', 'FND_GENERIC_MESSAGE' ) ;
fnd_message.set_token( 'MESSAGE', 'To date should be greter than from date.' );
fnd_message.raise_error ;
end if;
end; "



No comments:

Post a Comment