how to keep a value in the forms for 1 week [message #415411] |
Mon, 27 July 2009 10:31 |
zoey
Messages: 9 Registered: May 2005
|
Junior Member |
|
|
Hi, Have a form when it is invoked by pressing a button it displays all the documents assigned to the current user. if the user assigns the document to a different dept (for example SALES) then the values of "SALES" should be displayed on the form for 1 week since it was changed to "SALES", and the user should be able to see it each time he opens the form. that field should be also grayed out for 1 week .
after 1 week that value "SALES" shouldn't longer display on the from. Please help I have been stuck with this problem for weeks now...please show me how to keep a field's value in my form for 1 week since the date it was changed.
|
|
|
|
Re: how to keep a value in the forms for 1 week [message #415630 is a reply to message #415429] |
Tue, 28 July 2009 08:01 |
zoey
Messages: 9 Registered: May 2005
|
Junior Member |
|
|
Hi, changing the table is not an option. I have come up with the following script:
Declare
v_def_where varchar2(2000);
Begin
v_def_where := 'assigned_to = ''SALES'' and Sent_date > sysdate-7';
set_block_property('DOCS', default_where, v_def_where);
set_item_instance_property('docs.assigned_to' , to_number (:system.trigger_record), Enabled, property_false);
GO_BLOCK('DOCS');
EXECUTE-QUERY;
End
If this is correct. I don't know where I should put itin the block level or form level?
Please let me know...thanks in advance
|
|
|
Re: how to keep a value in the forms for 1 week [message #415639 is a reply to message #415411] |
Tue, 28 July 2009 08:38 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
If you've already got a date column you can use then you don't need to change the table.
Just add your where clause to the block where clause in the property pallete - you're always going to want to do that check so there's no point coding it seperately.
The set_item_instance_property call should go in the post-query trigger.
|
|
|
|