When validate trigger forms 6i
Please help me to create when validate item trigger.
There is one table "job" - id, status
status is X or null. i want to do in forms. when someone is entering value for id, it should check first the status for that id in job table status field.
if status is null then it should show msg "this id is already open for another job"
Edited by: only.ashish99 on Dec 26, 2012 1:44 PM
Hi,
So You mean that if the user dosent enter the staus then u need to show a message and if the entered status is there in ur table and then u need to show a message.
Just write in the when validate trigger
declare
v_status number;
begin
select count(status) into v_status from table;
If :Block.field_name is null then
message('');
Else
If v_status=0 then
ur action
else
Message('this job is exist for another');
End if;
end if;
End;
Try this.
Regards
Sri
Similar Messages
-
Problem with when validate trigger
Hi All,
I am using oracle forms 10g.
I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
message('enter supplier name') same under every field.
Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.
Can any one explain me what i have done wrong. The validation trigger is firing and giving message.
Regards
SrikkanthSrikkanth.M wrote:
Hi All,
I am using oracle forms 10g.
I have developed a custom form In that i have two block Header block and Detail block.In the header block some fields like Po number, po amount , supplier name, supplier site etc. And in the detail block i have po line details.
I have written a validation trigger under supplier name and supplier site, IF block.supplier_name is null then
message('enter supplier name') same under every field.
Now when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output. But the problem is When validate trigger fires when i press tab in PO Amount fields, Once i press ok it going to details block and querying.Hey, Srikkanth
Once you said
when the user enter po number it will go to po amount field and now when the user press tab it will go to the details block and query all the po related line,so i have written key-next under po_amount go-block and my code, Its works fine and giving the correct output.again you said
But the problem is When validate trigger fires when i press tab in PO Amount fieldsSo, i'm not getting you..
Can you clear it any more ? or any other way.. -
WHEN-VALIDATE-TRIGGER trigger looping so many times
Hi,
Below is the code written in WHEN-VALIDATE-TRIGGER trigger and after raise FORM-TRIGGER_FAILURE
the process is not stopping and the trigger message looping without end when
I tab to the next field or try to save the record. I am not sure why the flow did not stop
after the raise FORM_TRIGGER_FAILURE exception and the trigger looping again and again.
Please help me to know what is wrong in the code. This trigger written in ITEM level.
declare
msg_type varchar2(3);
msg_text varchar2(2000);
continue boolean;
begin
if :pom1_b22.qty < 0 then
message_ppkg.get_msg_from_db('RET','04060',msg_type,msg_text);
message(msg_text || '.');
bell;
raise form_trigger_failure;
else
continue := TRUE;
if :pom1_b22.qty is not null and :pom1_b22a.b22_query = 'FALSE' then
if nvl(:pom1_b22.irt_created,'N') = 'Y' then
if :pom1_b22.qty <> :pom1_b22.save_qty and
:pom1_b22.save_qty is not null then
if check_order_status then
continue := TRUE;
else
continue := FALSE;
message_ppkg.get_msg_from_db('RET','04061',msg_type,msg_text);
message(msg_text);
bell;
:pom1_b22.qty := :pom1_b22.save_qty;
raise form_trigger_failure;
end if;
end if;
end if;
if continue then
if :pom1_b22.save_qty is null then
if :pom1_b22.qty > :pom1_b22a.total_qty then
message_ppkg.get_msg_from_db('RET','04057',msg_type,msg_text);
message(msg_text || to_char(:pom1_b22a.total_qty) || '.');
bell;
raise form_trigger_failure;
end if;
else
if :pom1_b22.qty <> nvl(:pom1_b22.save_qty,0) then
if :pom1_b22.qty > :pom1_b22a.total_qty +
(nvl(:pom1_b22.save_qty,0) -
:pom1_b22.qty) then
message_ppkg.get_msg_from_db('RET','04056',msg_type,msg_text);
message(msg_text || to_char(:pom1_b22a.total_qty +
(nvl(:pom1_b22.save_qty,0) -
:pom1_b22.qty)));
bell;
raise form_trigger_failure;
end if;
end if;
end if;
end if;
end if;
end if;
end;Your Raise form_Trigger_failure Condition is not met hence not stopping the rest trigger body.
-
Issue with When Validate Trigger firing multiple times
Hi guys,
I have Designed a Form Personalization on a Form which Fires a concurrent Program (built in:execute Procedure) when a Record is Saved.
Below are the issues I am facing:
1.Concurrent Program is Firing Multiple Times after Saving the Record.
2.2 input Values to Concurrent Program are passed as NULL though I have Data but they are in Different Block of Form.
Note :I have When Validate trigger on 1 Block but i am trying to pass 2 Values on Another Block as input parameters for Concurrent program.But those values are getting as null when program fires.
Thanks.If EBS then post in {forum:id=475}
-
When validate trigger block level
Hi,
I Have a form application. On the entrance page If a user forget to enter his name or Password the form prompt the message to aware him about what is missing.
SO I wrote the folloing code on when validate trigger block level, but it did not work according to my needs, should I replace this trigger with other?
Sharbat
BEGIN
if:Block1.User is null then
message('Please enter the user name);
raise form_trigger_failure;
if:Block1.password is null then
message('Please enter the password'););
raise form_trigger_failure;
end if;
end if;
end;use
if:Block1.User is null then
message('Please enter the user name);
raise form_trigger_failure;
end if;
on key-next-item of user textbox
and
if:Block1.password is null then
message('Please enter the password'););
raise form_trigger_failure;
end if;
on the key-next-item of the password text box -
Problem using when-validate-trigger
Dear Experts,
After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
Please let me know which triiger i should use?
Thanks
Abhishek RustagiThere is no easy way to do this, however you could create a timer in your when-validate-item trigger which expires immediately, and place all of your navigational code in the when-timer-expired trigger - this way you could check the value which has been entered and navigate accordingly.
-
Problem in using when-validate-trigger
Dear Experts,
After validating a item value, I want to navigate to a specified item besed on that item value. If i use go_item('item1') in when-validate-trigger, error comes, beacuse we cannot use restricted built-in go_item in when-validate-trigger. If i use key-next-item on 'item1' for validating item value then while navigating through mouse it does'nt fire.
Please let me know which triiger i should use?
Thanks
Abhishek RustagiHi, the way I use to solve this problem is using both: key-next-item and when-validate-item. In the w-v-i you make the validations you need (this control mouse navigation) and in the k-n-i code write:
-- first validate the values, to avoid invalid values
execute_trigger ('when-validate-item');
-- if trigger fire corectly then you can go to the item you want..
if my_item = 'A' then
go_item(my_next_item1);
elsif my_item = 'B' then
go_item(my_next_item2);
end if;
Ruben. -
Hi All
I want message('please check the order');
and my code is
DECLARE
a VARCHAR2(200);
b varchar2(200);
BEGIN
select s.sale_order_no||sd.prod_id||sd.color,s.PERFORMA_TYPE INTO a,b from sale_order s,sale_order_detail sd
where s.id=sd.id and s.sale_order_no||sd.prod_id||sd.color=:gin_detail1.barcode and s.PERFORMA_TYPE!='ORDER CANCEL';
IF :gin_detail1.barcode = a THEN
SELECT SALE_ORDER_NO,prod_id,style,color,xs,s,m,l,xl,pcs INTO :gin_detail1.sale_order_id,:gin_detail1.prod_id,
:gin_detail1.prod_name,:gin_detail1.color,:gin_detail1.xs,:gin_detail1.s,:gin_detail1.m,:gin_detail1.l,
:gin_detail1.xl,:gin_detail1.pcs from sale_order_barcode where barcode=:gin_detail1.barcode;
ELSE
message('please check the order');
end if;
end;when-validate-item trigger raised unhandeled exception ora-01403
Thanks And Regards
Vikas SinghalHi,
Probably your first select statement itself throwing the error - ora-01403
So may be try to include an exception part for your code, to catch the exception ora-01403 -no data found
and there display the messgae- 'Please check the Order'.
Hope it will work then -
How to invoke when-validate trigger
Hi all ,
I just want to know how can i Invoke when-validate-item trigger of another item by without navigating to that item.
Exampls. I have two items A and B
I want to invoke item B's when-validate-item trigger by keeping the focus on A or being in A .first: write procedures for each when-validate.
e.g. WVI_name_of_the_item_A and WVI_name_of_the_item_B
then you start this procedure in item A and the other in item B.
now you can use the validation-procedure of B inside the validation of A
try it
Gerd -
When Validate Trigger is getting executed when Execute_query
i have a data block in which i have 2 text item. i have defined when validate item.
when the form is starting up i have given execute_query. before fetching the values my when validate item is getting executed. i dont want to do this. can one help me out in this caseHi,
Can you pls. check any initial value is given or not? Otherwise for quick solution you can declare a parameter upon which when-validate will validate the value. You can change value before and after 'EXECUTE_QUERY' statement. This is not a good idea. -
Problem while handling When-Validate-Record Trigger in Forms 6i
I am using below mention code in when validate trigger and use go block loop in when button pressed. if Check_Date_Range gives RAISE Form_Trigger_Failure error user will enter in a loop. kindly provide me solution for below mention problem.
BEGIN
Check_Date_Range(:Experiment.Start_Date,:Experiment.End_Date);
END;
** The procedure looks like this
PROCEDURE Check_Date_Range( d1 DATE, d2 DATE ) IS
BEGIN
IF d1 > d2 THEN
Message('Your date range ends before it starts!');
RAISE Form_Trigger_Failure;
END IF;
END;You have more chance to find a response if you post into Forms<br>
<br>
Nicolas. -
What trigger to use when wanting to form commit information
Want to commit information from form to database.
Only appears I can use when button push
The on validate record does not facilitate form commit
In previous forms versions used a post update trigger
however this one is not valid/recommended anymore.
THX IN ADVANCEThank you Sanjay for your response. I am currently using When Validate Trigger. It works for all the scenarios except when order line is cancelled.
When line cancelled I should rewrite the order quantity to 0 and save then only DFF's are updating to 0's.
Thanks, -
When-validate-record trigger only if a non database item is changed
Hi,
I am trying a code in the when-vaidate-record trigger in the BLOCK level.
The trigger should fire only if a checkbox item value is ticked(Value ='Y) for the present record(i.e, if already existing other records have a value ticked (='Y), it doesnt matter and trigger shouldnt fire)
Please help me achieve this :
The code I have tried in when-vaidate-trigger, which does not work as what I want :
DECLARE
X NUMBER;
BEGIN
if
nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
and :SYSTEM.RECORD_STATUS ='CHANGED'
then
set_alert_property(
'err_alert',
alert_message_text,
'You must enter a comment when defaulting localities.');
x := show_alert('err_alert');
RAISE FORM_TRIGGER_FAILURE;
end if;
END;The above code does not fire at all..
If I remove the part,
and :SYSTEM.RECORD_STATUS ='CHANGED'
it fires for "all records"(not just the currently changed records) where nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
Please help !!
Note: :DEFLOC.to_be_defaulted is a non database item ; :DEFLOC.COMMENTS is a database itemHi kriti,
There is one more way,
In the when-checkbox-changed trigger,
if :your_chk_box = 'Y' then
set_Record_property(:system.cursor_Record, 'your_blk',status,changed_Status);
else
set_Record_property(:system.cursor_Record, 'your_blk',status,Query_Status);
end if;
Then it is easy for you to find out the changed records using get_Record_property((:system.cursor_Record, 'your_blk',status)
Hey let me ask you one Question, is that check_box item is database item ???
If so,
it is easier..the fol. code will work for that
if nvl ( :DEFLOC.to_be_defaulted, 'N' ) = 'Y' and :DEFLOC.COMMENTS is NULL
and nvl(get_item_property('DEFLOC.to_be_defaulted',database_value),'N') = 'N' then
set_alert_property(
'err_alert',
alert_message_text,
'You must enter a comment when defaulting localities.');
x := show_alert('err_alert');
RAISE FORM_TRIGGER_FAILURE;
end if;otherwise
If your are creating that temp. item, it should be in the same block as non-db item.
I will explain this... You are setting the status of to_be_defaulted check box of some queried record to Y based on some conditions, right?
These records anyways are not updateable. Now your requirement is to find out the newly checked check boxes.
So in the post query or the place where you set to_be_defaulted as 'Y, we will default the new item with value Y, so that in the when validate trigger, you
know which record needs to attacked, It is those records with nvl( new item ,'N') = 'N' and to_be_defaulted = 'Y'...
Regards
Dora... -
Unable to validate the text with validate trigger
Hi I am facing one issue
I want to validate the password before going to another field, i put the following code on the when validate trigger,what i want if the password is wrong the cursor should go to the password field and clear the contents of that field only.When i put go_item and clear_item its giving error,pls find the following error and my code
FRM-40737:Illegal restricted procedure Clear_block in when validate Item trigger
declare
l_user varchar2(6) := null;
l_pass varchar2(10);
n_pass varchar2(10);
chkbutton number;
chk number;
Begin
select passwd into l_pass
from Trx_usr
where username = :USR.DISUSR;
if :global.pass = :TRX.PASSWD then
message('Login Sucesss');
else
chk:=show_alert('ALRLOG');
if chk = alert_button1 then
go_item('TRX.PASSWD');
clear_item;
end if;
end if;
end;
rgds
shreyI guess go call that code in the WHEN-VALIDATE-ITEM-trigger of the password-field itself? So you don't need any GO_ITEM. And instead of using CLEAR_ITEM you can just assign NULL; like
:TRX.PASSWD:=NULL; -
When-validate-item trigger restriction on open form or call form
W have when-validate-item trigger. I need to place a code here that will bring up a form when the "valid entry" on the item has been made. I am getting a frm-40737:Illegal restricted procedure COMMIT...
Code snippet on the procedure that I am calling from the when-validate-item:
IF :System.Form_Status = 'CHANGED' THEN
Commit_Form;
end if;
Call_Form ('MY_FORM', HIDE, NO_REPLACE, NO_QUERY_ONLY,'PARAM');
Is there a work-around. We also cannot use timers here.
Any help is appreciated?
TIAThanks Sudha, I tested and it worked with the key-next-item trigger.
The only thing though, I was told that the users will not use the enter key when they navigate out of the field, it is either clicking on an exit button or function key F4...so I am still stuck with the same problem.
This site is really helpful and I hope to receive more ideas.
Thanks!
Maybe you are looking for
-
HELP!-I NEED A LOUDER AIFF!
are there any programs that boost the master volume of an AIFF file? i've finished an album i've been working on in my bedroom with garageband and my blue snowball microphone. i've mastered it so none of the tracks "clip" and go into the red during t
-
I have purchased an Apple TV and an Airport Express as a gift for a loved one and was under the impression that these two would not only allow for movies, videos etc would be streamed to the TV from my MacBook Pro, but also set up Airport Express wit
-
Distorting text/images in converting from pmd to pdf
My company uses PageMaker 7.0 to create our manuals and brochures and then converts them into pdf's. I've run into this problem before and found that if I didn't properly place or import an image (not copy and paste an image or text) that once conver
-
EntryProcessor invokeAll returning empty ConverterMap{}
Hi All, I am trying to write a custom entryprocessor and whatever I return from the invokeAll method in the entryprocessor, I am always getting a empty ConverterMap{}. The code for the entryprocessor is as below: public class CustomEP implements Port
-
Objects in a circle around another object
Hey everyone, I work for a non-profit and we are adding more Partner's to our building, and so we need to add them to our "Partners" page, which currently looks like this: http://gapfamilycenter.org/partners.php <- that doesn't work for 13 partners,