Correct trigger for GO_RECORD, GO_ITEM [message #395935] |
Fri, 03 April 2009 03:33 |
Nshan
Messages: 62 Registered: February 2009
|
Member |
|
|
Hi,
I am using one form.
In that i want to do some run time validation(Duplication Check).
At the time of saving i should be alerted that i have entered multiple records in a form.
Ex:
Reason_code path
----------- ------------
CM1 CSA
CM1 CSA
if i go and save then it should alert me for multiple entries.
For navigation purpose i used GO_RECORD, FIRST_RECORD, GO_ITEM.
Those builtin's are not possible in pre & post and validation an ON triggers.
Can any one tell which trigger i should use to call my duplication check procedure.
Thanks in advance!
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Correct trigger for GO_RECORD, GO_ITEM [message #395965 is a reply to message #395964] |
Fri, 03 April 2009 05:53 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
mm_kanish05 wrote on Fri, 03 April 2009 11:46 | hi
@cookiemonster
Quote: | And what trigger would you put that code in?
|
at key-next-item
|
What happens if the user uses the mouse to navigate out of the item?
Or shift-tab?
Or key-down?
Nshan wrote on Fri, 03 April 2009 11:41 |
Can you give me some sample code for cursor example?
|
If you don't know how to write a cursor to find a single record I suggest you start reading the manuals.
If you don't know how to post - it's an oracle forms built-in, look it up.
|
|
|
|
|
Re: Correct trigger for GO_RECORD, GO_ITEM [message #395976 is a reply to message #395965] |
Fri, 03 April 2009 07:05 |
Nshan
Messages: 62 Registered: February 2009
|
Member |
|
|
I am asking how to use cursor variables in side the code
not basic cursor things.
Ex:
DECLARE
cursor cur is select :BlockName.reason_code
from dual;
BEGIN
for i in cur
loop
If (i.reason_code = r_code) then
FND_MESSAGE.SET_STRING('Multiple entries for reason code');
FND_MESSAGE.SHOW;
RAISE FORM_TRIGGER_FAILURE;
Exit;
End if;
End Loop;
End;
I think i cant use i.reason_code???
I am asking how to access cursor values those things.
I am very new to forms thatz y i am asking.
|
|
|
|
|
Re: Correct trigger for GO_RECORD, GO_ITEM [message #396517 is a reply to message #395976] |
Tue, 07 April 2009 01:27 |
|
Nshan wrote on Fri, 03 April 2009 17:05 | I am asking how to use cursor variables in side the code
not basic cursor things.
Ex:
DECLARE
cursor cur is select :BlockName.reason_code
from dual;
BEGIN
for i in cur
loop
If (i.reason_code = r_code) then
FND_MESSAGE.SET_STRING('Multiple entries for reason code');
FND_MESSAGE.SHOW;
RAISE FORM_TRIGGER_FAILURE;
Exit;
End if;
End Loop;
End;
I think i cant use i.reason_code???
I am asking how to access cursor values those things.
I am very new to forms thatz y i am asking.
|
i dont think it will iterate for the whole block records.
u first ned to go the the first record, then iterate using next_record until u reach teh last record, u need to skip the current record (since it will find a duplicate value)
and u can apply your code logic at when-validate-record trigger.
pls try and tell.
|
|
|
|
|
|
|
|
|