1) Difference between FROM ATE and TO DATE is 2 months or 62 days..
Default Value: (From Date)
SELECT fnd_date.date_to_chardate(TO_DATE(ADD_MONTHS(LAST_DAY(TRUNC(SYSDATE)),-2) +1,'DD-MM-RRRR')) FROM dual
Value_Set: XXIDEA_WARES_DAYS4
Click on Edit Information Button and
FND PLSQL " DECLARE
l_count NUMBER := 0;
l_value date := :!value ;
BEGIN
SELECT trunc(l_value - to_date(':$FLEX$.P_FROM_DATE','YYYY/MM/DD HH24:MI:SS'))
INTO l_count
FROM dual;
IF l_count > 62 THEN
fnd_message.set_name( 'FND', 'FND_GENERIC_MESSAGE') ;
fnd_message.set_token( 'MESSAGE', 'You can run report for 2 months period.Please change from date and to date.' );
fnd_message.raise_error ;
END IF;
END;"
2) Current Parameter value should be less than or equal to SYSDATE..
Value Set: XXIDEA_WARES_DAYS5
Click on Edit Information Button and
Event: Validate
FND PLSQL " DECLARE
l_date DATE := :!value;
BEGIN
IF l_date > SYSDATE
THEN
fnd_message.set_name( 'FND', 'FND_GENERIC_MESSAGE') ;
fnd_message.set_token( 'MESSAGE', 'Date should be sysdate or less than sysdate.' );
fnd_message.raise_error ;
END IF;
END;"
Note: 1. Form Concurrent Program we will get the current parameter value to the value set “:!value” as in above code.
Nice document, it helped me to achieve similar Requiremnet. Tahnk You!!
ReplyDelete