Forms [message #523310] |
Fri, 16 September 2011 12:04 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
SQL Plus version Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.1.0 Production
Forms Version : 6i
Reports Version: 6i
O/S : Microsoft Windows Xp professional Version 2002 Service Pack 3
Hi
With reference to the above version details here is the requirement.
How do I restrict user on key next item trigger i.e I want the cursor to move to next field only when user presses "ENTER" button on the key board any other key like mouse should not allow user to move to the next field.
Any help will be much appreciated.
Regards
Zahid
|
|
|
Re: Forms [message #523315 is a reply to message #523310] |
Fri, 16 September 2011 12:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
What about making the field ENABLED = NO and then enabling it upon leaving the first field, then making it disabled again once they leave that field?
|
|
|
Re: Forms [message #523320 is a reply to message #523315] |
Fri, 16 September 2011 13:19 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Thanks for your reply. Couldn't understand your reply please elaborate.
Let me be more precise. This text item has a key-next-item trigger associated with it which checks for duplicate records. i.e it displays all records that exist on the entered post code, thereby avoids any duplicate record living on the same post from entering the database,and the trigger reads like this
[/PACKAGE BODY blk_contacts IS
PROCEDURE NAME(event varchar2) IS
BEGIN
if event IN ('KEY-NEXT-ITEM','KEY-DOWN') then
init;
go_item('tbl_Contact.Contact_address');
set_item_property('button_bar.psave',enabled,property_true);
elsif
event IN ('KEY-UP','KEY-PREV-ITEM') then
go_item('tbl_Contact.Contact_title');
end if;
END NAME;
PROCEDURE PCODE(event varchar2) IS
var number(5);
alr_dup number(5);
BEGIN
If event IN ('KEY-NEXT-ITEM','KEY-DOWN') then
if :tbl_contact.contact_pcode is not null then
select count(contact_pcode) into var
from ihelp.tbl_contact
where contact_pcode=:tbl_contact.contact_pcode
and contact_code<>:tbl_contact.contact_code;
if var>0 then
show_window('win_dup');
go_block('vew_dup');
set_block_property('vew_dup',default_where,'upper(ltrim(rtrim(contact_pcode)))='||upper(ltrim(rtrim(''''||:tbl_contact.contact_pcode| |''''))));
execute_query;
go_item('vew_dup.NB');
else
go_item('tbl_Contact.Contact_title');
end if;
else
go_item('tbl_Contact.Contact_title');
end if;
elsif event IN ('KEY-PREV-ITEM','KEY-UP') then
go_item('tbl_contact.active');
end if;
END PCODE;
END BLK_CONTACTS;--end package]
Please provide your further help on this. The requirement is only user can move with the enter Key from the keyboard any other key should not take user to the next item including mouse click
Regards
Zahid.
[Updated on: Fri, 16 September 2011 15:07] by Moderator Report message to a moderator
|
|
|
Re: Forms [message #523336 is a reply to message #523320] |
Fri, 16 September 2011 15:14 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Set the field ENABLED property to NO on the field you do not want to allow user to go to.
On KEY-NEXT-ITEM of previous field, do whatever checks you have to do, then set the ENABLED property of the non-enabled field you want to go to YES (and possibly INSERT ALLOWED and UPDATE ALLOWED property as well). Then add the NEXT-ITEM as the last item in the trigger.
When you leave the field restricted field, set the ENABLED property back to NO so no one can get there unless they use the [enter] key from the previous field of that field.
This is all just a guess however.
|
|
|
Re: Forms [message #523661 is a reply to message #523336] |
Mon, 19 September 2011 12:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Thanks for that
I am thinking like this [/if ASCII('BUFFER') <> '13' then
Message ('Press Enter Key to Proceed');
Message ('Press Enter Key to Proceed');
raise form_trigger_failure;
else
NEXT_ITEM;
end if;
above code compiles successfully and displays the message even when the user has pressed ENTER KEY (I believe the ASCII value for Enter is 13)
[Updated on: Mon, 19 September 2011 13:09] by Moderator Report message to a moderator
|
|
|
Re: Forms [message #523681 is a reply to message #523661] |
Mon, 19 September 2011 18:06 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Is there a particular reason why you want to prevent the users from using tab to get to the next item?
|
|
|
Re: Forms [message #523831 is a reply to message #523681] |
Tue, 20 September 2011 09:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Yes, As I mentioned earlier that the key-next item and key down associated with text item "Contact_Pcode" have trigger written which checks for duplicate Post code i.e say for e.g: if A person lives on B12 8XD and person B also lives on the same post code, the associated trigger fires and show list of all person that lives on the same post code. Assuming the scenario above if a new contact comes for entry and his/her name is A or B sharing same door number, road/street name will cause duplication in the database. i.e two ID's get created for the same person. This is evident because users don't bother to press the Enter key,in fact use mouse to move down to the next field and the associated trigger does not get the chance to fire.
Please reply.
|
|
|
Re: Forms [message #523833 is a reply to message #523831] |
Tue, 20 September 2011 09:23 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
1) You could just add code to when-validate-item or when-validate-record to check for dupes.
This wouldn't allow automatic querying of the existing data, but would ensure they can't enter dupes no matter what.
2) You could turn mouse navigable off.
3) enter does the same thing as tab - causes key-next-item to fire - hence my question.
Regardless you can't check to see if the user has pressed enter explicitly - the field isn't set to enter,
enter (and tab) causes the trigger to fire.
|
|
|
SQL [message #524053 is a reply to message #523310] |
Wed, 21 September 2011 09:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
SQL Plus version Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
PL/SQL Release 8.0.5.1.0 Production
Forms Version : 6i
Reports Version: 6i
O/S : Microsoft Windows Xp professional Version 2002 Service Pack 3
Please refer to the attachment for actual query which says ora- 01843 (Not a valid month)
-
Attachment: post.JPG
(Size: 110.43KB, Downloaded 676 times)
|
|
|
|
Re: SQL [message #524070 is a reply to message #524062] |
Wed, 21 September 2011 12:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
to_char(to_date(receipt_detail_month||' '||receipt_detail_year,'Month rrrr'),'Mon rrrr') receipt_month,
What if you did:
to_char(to_date(''''||receipt_detail_month||' '||receipt_detail_year||'''','Month rrrr'),'Mon rrrr') receipt_month,
[uh-oh]
Sorry, I don't know how I did it, but somehow I deleted your part of the message with the error (when I thought I was making a response to the message). However, try my solution to see if it works.
[Updated on: Wed, 21 September 2011 12:56] by Moderator Report message to a moderator
|
|
|
Re: SQL [message #524087 is a reply to message #524070] |
Wed, 21 September 2011 14:15 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Instead of this
to_char(to_date(''''||receipt_detail_month||' '||receipt_detail_year||'''','Month rrrr'),'Mon rrrr') receipt_month
I tried
to_char(to_date(''||receipt_detail_month||' '||receipt_detail_year||'','Month rrrr'),'Mon rrrr') receipt_month,
worked fine when restricted the query to where clause in SQL Plus by specifying a receipt_code, but unfortunately didn't work in Report builder throws the same error
ORA- 01843 Not a valid month.
|
|
|
|
Re: SQL [message #524093 is a reply to message #524088] |
Wed, 21 September 2011 14:37 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
You are right Littlefoot. The distinct records in this column are as follows
SQL> select distinct receipt_detail_month
2 from
3 tbl_receipt_detail;
RECEIPT_D
---------
April
August
December
February
January
July
June
March
May
November
October
RECEIPT_D
---------
September
Term 1
Term 2
15 rows selected.
What needs to be done.
Thank You
|
|
|
Re: SQL [message #524107 is a reply to message #524093] |
Wed, 21 September 2011 15:13 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
Term 1 and Term 2 are not valid Months, at least in english they are not.
|
|
|
|
Re: SQL [message #524282 is a reply to message #524131] |
Thu, 22 September 2011 11:00 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Thanks to all , yes its been sorted out by omitting Term1 and Term2 using where clause.
Another requirement is How do I achieve this.
I have a LOV attached to a text item (purpose_name) called (Lov_purpose). There is one more text item before (purpose_name)called (category_amount)which stores donation amount.
The requirement is such that if user enters amount Less than 100.00 then the column "water pump" (which is one column among other 70 available in the LOV) should not be visible in the LOV called (Lov_campaign)and remaining 70 must be visible.
How do I achieve this.
|
|
|
|
|
|
Re: SQL [message #524563 is a reply to message #524363] |
Sat, 24 September 2011 15:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Thanks for the sample code Littlefoot.
I am thinking differently. Since the LOV (Lov_Purpose) is based on table named "tbl_purpose". Cant we set LOV property or Record Group Property by checking amount in the "category_amount" on (key-next-item or key-down) field if entered amount is less than 100.00 then the option "water Pump" shouldn't be visible to the user(s) in the LOV.
The description of Tbl_Purpose;
Name Null? Type
------------------------------- -------- ----
PURPOSE_CODE NUMBER(5)
PURPOSE_NAME VARCHAR2(45)
and water pump is tagged with purpose_code = 23 in the table
Could you please suggest.
|
|
|
|
Setting LOV property [message #524784 is a reply to message #523310] |
Mon, 26 September 2011 14:32 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Hometown
Messages: 35 Registered: October 2010 Location: India
|
Member |
|
|
Can we have two LOV's one with Water Pump and one without it and later swap them depending upon the amount entered in Category_amount.
for eg:
if :tbl_category_detail.category_amount < 100 then
set_item_property (:block.item_name,show_lov,lov_2)
LOV_2 would be one without water pump
I don't know whether set_item_property allows this.
Please help
Regards
Hometown
|
|
|
Re: Setting LOV property [message #524809 is a reply to message #524784] |
Tue, 27 September 2011 00:06 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Yes, you can switch from one LOV to another.
All built-ins are very well described in Forms Online Help System - I suggest you learn how to use it.
|
|
|