Validation in POST-TEXT item trigger
Hi
Does POST-TEXT -ITEM trigger fire in ENTER-QUERY mode?
If not suggest me solution for following scenario:
I have supplier field in master block. When Form is in -ENER-QUERY mode, i want to validate the user input in the supplier field before user navigate out of the field using TAB KEY (KEY-NEXT-ITEM) or MOUSE (POST-TEXT-ITEM).
Thanks
Cheers
Ram
The Forms help says that it doesn't, and nor does when-validate-item.
It looks like you'll have to use the when-new-item-instance trigger. You can store the value of the current field and whenever the trigger fires, run some code to validate that field. If it passes the validation then store the value of the new field, otherwise put the user back in the original field.
You'll also need to call the code from the key-exeqry trigger, so that you can validate the field which the user is in when they execute the query.
Similar Messages
-
Diffrence between when-validate-item and post-text-item trigger
What is the Diffrence between when-validate-item and post-text-item trigger, when they are written for the same item and the basic diffrence between when-validate-item and post-text-item trigger.
Two big differences:
1. post-text-item is only available to, and only triggered when leaving a text item, whereas when-validate-item is triggered by the forms validation process, and is available for any item type.
2. p-t-i is a navigation trigger and you cannot invoke it programmatically, whereas the 'validate' built-in can be used to execute validation which fires the w-v-i trigger(s). -
FRM-40737: illegal restricted procedure COMMIT in POST-TEXT-ITEM trigger
Hi All,
I tried to execute an insert statement in a POST-TEXT-ITEM trigger and use commit to save data in the db but this error appeared:
FRM-40737: illegal restricted procedure COMMIT in POST-TEXT-ITEM trigger
How to solve it? OR how to save every text item value entered in the database?I don't fully understand, why you need to insert records on post-text-item, but the possible solution is:
Write a DB procedure which does insert and commits it.
Call this procedure in post-text-item.
Problems will occur if your procedure is modifying the table columns, which are used in form. Form will notice that values in DB have changed and you will have "Record has been changed by another user. Please requery to see changes" error. But if records, affected by DB procedures, are not used in form, the wverything will be OK. -
I have a master block and a detail block, which is a multi
record block; for one item in the detail block I created a post-
text-item trigger to check if this value exists;
the problem now is that this trigger not only fires if I leave
the item, it also fires at the beginning when the canvas is
dieplayed and I execute a query
can anybody tell me why this happens and how to avoid it?
thx in advance, michaela
nullMichaela (guest) wrote:
: I have a master block and a detail block, which is a multi
: record block; for one item in the detail block I created a
post-
: text-item trigger to check if this value exists;
: the problem now is that this trigger not only fires if I leave
: the item, it also fires at the beginning when the canvas is
: dieplayed and I execute a query
: can anybody tell me why this happens and how to avoid it?
: thx in advance, michaela
What happens in your form is perfectly normal.
You should use the When-Validate-Item trigger, and, eventually,
set the text-item required.
null -
Execute query when post text item
Anybody can help ?
I create 2 block, first a data block and another is a control block with field customer_search field,
after inputing customer id in search field on control block,
I want to execute query.
my code :
set_block_property('customer',default_where,'custid=:control.customer_search');
execute_query;
error : frm-407 : illegal restricted procedure execute_query in post-text-item trigger.
How to solve this problem ?
notes: If I create one push button and put execute_query in there, every thing is fine.
but the my user does not like that.
Thank.hi,
first of all change ur statement as
set_block_property('customer',default_where,'custid='||:control.customer_search);
means u must use pipe sign while using bind variable
secondly
u should use key next item trigger
go_block(user desired item or block);
--and then use this satemant
clear_block(no_validate);
execute_query(no_validate);
i hope it wil slove ur peoblem if it will NOT then please acknowledge otherwise we will go for a other solution
thanks
imran
manager IT
www.masoodtextile.com -
Go-item in post-text-item oracle forms 6i
It is not possible to use go_item in post-text-item trigger in forms 6i
How to overcome this?I've never tried to force the user to do that.
But Kevin's second solution would do it:
Set a packaged variable and put the code in a form-level WHEN-NEW-ITEM-INSTANCECreate a package specification in the form -- I always name such a package P0.
In the package, create a variable: Next_Itm varchar2(60);In your post-text-item trigger, set the package value: P0.Next_Itm := 'BLOCK_B2.ITEM_6';In the form-level when-new-item-instance trigger:
If P0.Next_Itm is not null then
Go_Item(P0.Next_Itm);
P0.Next_Itm := null;
End if; -
How can i back to Text Item ???
i have TextItem
. in Post_Item Trigger i am Checking the value in Text Item
With Value in DataBase and Get Other Data Related by this value into another Text Item.
if value not Found in dataBase how can i came back to Text_item to change the value .
like text item contain code and return Name into another TextItem
if code not found do not leave TextItem.First of all, do NOT do validation like that in a post-text-item trigger. You are needlessly running validation every time the user tabs through the field.
You should be putting validation ONLY in a when-validate-item or when-validate-record trigger. They only run if the value has been changed.
And any time you issue an error message, it must always be followed by RAISE FORM_TRIGGER_FAILURE; -
Display Hint Text in Oracle Forms 6i at Text Item
Dear all seniors
I want to show Hint text at Text Item in Oracle Forms 6i.
when my cursor Focus goes at that item. I mean when I go with Tab key or Enter button then it show display text.
even though my mouse is not on that item.
please how it would be possible
thanks.
G.YPlease create a display_item(for eg. Disp_Mess) just below the text field (For eg:-MyField) where you want to show hint. And then assighn Hint text to "DISP_MESS" in NEW-FORM-INSTANCE or at Initial value. Then create a PRE-TEXT-ITEM and POST-TEXT-ITEM trigger for MyField.
-- PRE-TEXT-ITEM trigger write following code.
SET_ITEM_PROPERTY('DISP_MESS',VISIBLE,PROPERTY_TRUE);
--POST-TEXT-ITEM write following code.
SET_ITEM_PROPERTY('DISP_MESS',VISIBLE,PROPERTY_FALSE);
It will work for you.
Regards
Ahamed Rafeeque Cherkala -
Navigating to the text item with color
hi all,
i have 10 text_items in my form, i want that when i am in first text_item the color should change default to any color i want (take suppose yellow)
then when i am going to second text_item then color should change to yellow like that it has to happen for all the text_items.
how can i do this... where i should write the code and what code...
please reply...Create one VISUAL ATTRIBUTE with background color = yellow and use the code as below on block level triggers.
1. Create one trigger on block-level called PRE-TEXT-ITEM and use the code as below...
SET_ITEM_PROPERTY(:SYSTEM.CURRENT_ITEM,VISUAL_ATTRIBUTE,'VISUAL_ATTRIBUTE_NAME');2. Create another trigger on block-level called POST-TEXT-ITEM and use the code as below...
SET_ITEM_PROPERTY(:SYSTEM.CURRENT_ITEM,VISUAL_ATTRIBUTE,'DEFAULT');-Ammad -
How do you write UNDO for a text item?? examples? or a REDO??
How do you write UNDO for a text item?? examples? or a REDO??
I created a pop-up menu with CUT, COPY, PASTE, UNDO, CLEAR for my text items.
Using MAGIC menu type works great but there is no MAGIC for UNDO or REDO.....
How do you write UNDO for a text item?? examples? or a REDO??
I have Oracle Forms 6i...
Lets say I highlight all the text in the text item, and start typing over it... then I realize OH NO it is the wrong text field...
Now I want to UNDO the typing and get back to the previous text.
I'd use the initial value that was populate right? How do I access that if that is correct?
Thanks, BillYou can use;
<ITEM> := Get_Item_Property(<ITEM>,DATABASE_VALUE);
Or you will have to write a pre-text-item trigger;
PRE-TEXT-ITEM:
:CTRL.CURRENT_VAL := :<BLOCK>.<ITEM>
MENU (PL/SQL):
:<BLOCK>.<ITEM> := :CTRL.CURRENT_VAL;
You may also want to set the item property back to ITEM_IS_VALID so that item validation does not fire again. -
Hi
I am creating an application which needs dynamic creation of text item.
ie., after POST-TEXT-ITEM I want to creat another text box beneath the existing text item.
Is there any possibilities that we can create the text item by Code.
Thanks in advance
VijendraHi ,
Take a look at the following:
Building a dynamic block at run-time
Regards,
Simon -
Text item validation into Formular.
hi.
From some days I have written my fiirst application using Oracle Forms6i.
In oracle9i I created table USER with column id_user number(5), username varchar2(10) and passwd varchar2(12).
In oracle forms builder I created the formular with 4 controls(2 fields - username and passwd ,one button to login user and Text item to the botton of this formular to print message for user). In ProperPalette for Text item 'username' and 'passwd' I set adequately Maximum Lenght peperty to 10 and 12(for 'passwd' field) and Required to Yes.
Then I wanted to make a validation username and passwd fields in this way, that the user can put in 'username' field the string with length between 8 to 10 and for 'passwd' between 8 to 12 and checking all other cases incorrect data entering by login user.
I created trigger WHEN-MOUSE-CLICK for button with this body:
declare
dlug_username number;
dlug_passwd number;
begin
dlug_username := length(:user_data_log.username);
dlug_passwd := length(:user_data_log.passwd);
if (:user_data_log.username = NULL and :user_data_log.passwd = NULL) then
:user_data_log.komunikaty_logowania := 'you didn enter any data!';
elsif dlug_username >= 8 and dlug_passwd >= 8 then
:user_data_log.komunikaty_logowania := 'Correct data!';
elsif dlug_username < 8 or dlug_passwd < 8 then
:user_data_log.komunikaty_logowania := 'Fields USERNAME i PASSWD must have more then 8 sign. Correct them!';
:user_data_log.username := '';
:user_data_log.passwd := '';
end if;
exception
when VALUE_ERROR then
:user_data_log.komunikaty_logowania := dlug_username;
end;
When I run this form by Run Form client/server button, it's not matter what I'll enter in two field 'username', 'passwd', when I press button always is invoke exception section
but no if condition.
Now, I don't know what do with this. What is the best way to resolve problems with validation of form elements?
Thanks in advance for all help, some hints, tutorials. I appologise for so long post, but I
want directly describe my problem. Thanks.Hi,
Regarding to your post and your problem , obviously the code doesn't go into the
IF condition and validate it becouse the syntax is not appropriate and every time it goes to the IF it jumps into the exception part. Thats why you have to correct your code as fllowing.
if (:user_data_log.username IS NULL) and (:user_data_log.passwd IS NULL) then
etc till the end of the code.
Kindly if this approach meet your requirment of solving , update your problem with a Subject of Solved
Regards
Omar -
Hi all,
i have a text item P6_MAXLIABILITY
I put a validation on that item with regular expression.
I want that validation to happen, when the focus moves to the next item.
could any one give me a suggestion?
bye
SrikaviHi,
if the focus changes the javascript is event "onblur();" automatically fired. Then you can call own javascript function and validate the input.
Example:
<form name="test" action="">
Name: <input type="text" name="input1" onblur="checkContent(this.value)">
</form>
<script type="text/javascript">
document.test.input1.focus();
function checkContent (field) {
if (field == "") {
alert("Please input something!");
document.test.input1.focus();
return false;
</script> -
What is the Pre Trigger for combo item same like Pre-Text-Item.
Hi Everyone,
Can anyone help what is the same trigger like Pre-Text-Trigger for combo items.
Thanks in advance.Thanks for your reply Mr. Ammad,
--vDatabaseValue:=GET_ITEM_PROPERTY('item_name',DATABASE_VALUE);
This will fetch the value from the database. But what I need is to store the value of the item itself.
For example:-
I created one combo box called Item_Code and one text item called Quantity in my form.
I am choosing the item code from the combo box lets say 'ABC123' then my cursor moved to Quantity.
Now I am again coming back to the Item_Code to change the value which already I choosed 'ABC123', here I need to store that value 'ABC123' into an global variable before to change.
Hope you understand.
Thanks. -
Validating list item with text item havin LOV, how 2 do?
Dear Sir’s,
I have two items,
a) emp_id which is a TEXT ITEM having a LOV
b) dept_name which is a LIST ITEM.
Suppose, those employee id’s having 100 and 101, when selected from the LOV, the dept_name list item should automatically become IT_DEPT and the user should not be able to change the value in the list item and the cursor should not be navigable. Like wise, when employee id is 102, the dept_name should show, some of the specific name from the list and not navigable.
For this, what should I do? Please help me.
Mitto.First in the LOV query select the department name. In the LOV properties, in column mapping properties make the field width as 0 so that it will not be visible in the LOV. In the return item field browse for the item and select it.
In the run time, upon clicking the lov, the value will be populated automatically.
I hope this helps.
Regards,
Anantha Narayanan
http://askanantha.googlepages.com
Maybe you are looking for
-
Unable to restore, gives me an error message!
My ipod has been on the fritz for well over 3 weeks now. Its a click wheel ipod, w/ the black and white screen. I've been ignoring the problem, and now i have a big problem. At first my ipod was reading the very low battery screen, so i left it charg
-
I have a list which has a underlying infopath form for insert and edit a record. The list has various views spread across different pages . Now depending on different pages "New Item", a value for the form will have a corresponding value. If there is
-
what is wrong with my headphone jack? i have an ipod touch 4th generation ipod touch every pair of headphones and earbuds i plug in it has the same sound going to both sides.
-
User-exits or BAdI for transaction VL10B
Hello everybody, I have to modify an outbound order during its creation from a purchase order in transaction VL10B. The modification is to update the serial numbers and the batch. As the process is in background it is quite difficult to debug the pro
-
Access consignment info records while costing
Hi I have a valuation variant in which the strategy for material costing has a sequence in which i want to access price from info records while costing thru ck11n or ck40 If i create normal info records,i am able to access the price from info records