Home » Applications » Oracle Fusion Apps & E-Business Suite » How to restrict To date parameter, based on From date parameter ?
How to restrict To date parameter, based on From date parameter ? [message #450777] Fri, 09 April 2010 03:02 Go to next message
chandramatta
Messages: 15
Registered: January 2010
Junior Member

Hi Guys,
I am looking for a feature to restrict my TO date parameter based on the From date parameter.
For ex:
If I enter From date as 08-APR-2010 then, my from date should be 08-MAY-2010. I.e from date + 30 days
- And I should not be able change my To date above 30 days. It should be always <= 30 days.
Is there a way to do this ?

Thanks,
Matt
Re: List Of Values & Value Set [message #450827 is a reply to message #450777] Fri, 09 April 2010 07:29 Go to previous messageGo to next message
eric62
Messages: 24
Registered: January 2009
Junior Member
Hello.

I think a special value set.

http:\/\/knol.google.com\/k\/using-pl-sql-in-a-special-validation-type-value-set#

(delete \ from the link)

Eric.
Re: List Of Values & Value Set [message #477473 is a reply to message #450827] Thu, 30 September 2010 20:53 Go to previous messageGo to next message
Ashish4u
Messages: 1
Registered: March 2009
Location: KOLKATA
Junior Member
You can create one value set for to date which will be dependent on from date and put condition as where to_date = :$FLEX$.<From_Date_Valueset> + 30
Re: List Of Values & Value Set [message #477655 is a reply to message #477473] Sun, 03 October 2010 02:08 Go to previous messageGo to next message
aheli
Messages: 10
Registered: August 2008
Location: India
Junior Member
Ashish4U is right .. do it as he suggests
Re: List Of Values & Value Set [message #514874 is a reply to message #477655] Thu, 07 July 2011 02:45 Go to previous messageGo to next message
Raghu_dev
Messages: 2
Registered: July 2011
Location: Banglore
Junior Member
hi guys,
i tried the above logic but it is not wrking
i used below code in to date's value set and selected validation type as special

FND PLSQL "Declare

l_to DATE := TO_DATE(:!VALUE);
l_from DATE := :$FLEX$.STANDARD_FROM_DATE;

BEGIN
IF l_to is not null and l_from is not null and l_to > l_from+30 THEN
fnd_message.set_name( 'FND', 'Select Value with in 30days' ) ;
FND_MESSAGE.RAISE_ERROR ;
END IF ;
END ;"

attached error screen is displayed when entered from date
  • Attachment: issue.jpg
    (Size: 42.59KB, Downloaded 1006 times)
Re: List Of Values & Value Set [message #514875 is a reply to message #514874] Thu, 07 July 2011 02:58 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:
i used below code in to date's value set

Quote:
error screen is displayed when entered from date

Which means that code you posted is useless - form never came to that point. Perhaps you'd rather post code (if there's any) that is related to "from date".
Re: List Of Values & Value Set [message #515222 is a reply to message #514875] Fri, 08 July 2011 13:53 Go to previous messageGo to next message
AlexAnd
Messages: 18
Registered: March 2010
Junior Member
You may try

create value set for TODATE (as VSTODATE based on FND_STANDARD_DATE )
for value set FROMDATE (as VSFROMDATE ) in
table name set "select :$FLEX:VSTODATE + 30 dt from dual"

Not tested

[Updated on: Fri, 08 July 2011 13:54]

Report message to a moderator

Re: List Of Values & Value Set [message #515223 is a reply to message #514874] Fri, 08 July 2011 14:54 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Lets say if you are using the standard value set FND_STANDARD_DATE for the 'From Date'.
You can create the Special value set as follows and attach that to 'To Date'.
FND PLSQL "DECLARE
    l_to_date DATE := fnd_date.displaydate_to_date(:!VALUE); -- Date in 'To Date' parameter.
    l_from_date DATE := fnd_date.canonical_to_date(':$FLEX$.FND_STANDARD_DATE'); -- Date in 'From Date' parameter.
BEGIN
    IF l_to_date IS NOT NULL 
        AND l_from_date IS NOT NULL 
        AND NOT l_to_date BETWEEN l_from_date AND l_from_date + 30 THEN
        FND_MESSAGE.SET_NAME('FND','Select Value with in 30days'); 
-- Better to seed one message name instead of hard coding the text.
        FND_MESSAGE.RAISE_ERROR;
    END IF;
END;"
Tested.

By
Vamsi

[Updated on: Fri, 08 July 2011 15:09]

Report message to a moderator

Re: List Of Values & Value Set [message #515224 is a reply to message #515223] Fri, 08 July 2011 15:34 Go to previous messageGo to next message
AlexAnd
Messages: 18
Registered: March 2010
Junior Member
also try

for parameter FROMDATE in concurrent definition:

Default Type: SQL Statement
Default Value: Select :$FLEX$.FND_STANDARD_DATE + 30 from dual
or
Select fnd_date.canonical_to_date(:$FLEX$.FND_STANDARD_DATE) + 30 from dual

test this.

i think it will be easy =)
Re: List Of Values & Value Set [message #515236 is a reply to message #515224] Sat, 09 July 2011 00:13 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Quote:
It should be always <= 30 days.
How default value will take care of this scenario?
This will default ONLY 'To Date' to 'From Date' + 30.
But we need to allow user to change that to only with in 30 days.
If the user wants both default value and the restriction, then the default value like above and the restriction using special value set like in my post.

By
Vamsi
icon7.gif  Re: List Of Values & Value Set [message #515364 is a reply to message #515236] Mon, 11 July 2011 02:43 Go to previous message
Raghu_dev
Messages: 2
Registered: July 2011
Location: Banglore
Junior Member
Thanks a lot for your help guys...its working now
Previous Topic: Personalization issue
Next Topic: Oracle Apps
Goto Forum:
  


Current Time: Thu Apr 18 07:58:02 CDT 2024