Repeat items [message #299146] |
Sun, 10 February 2008 01:45 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
ashraf_al_ani
Messages: 92 Registered: October 2007 Location: Iraq
|
Member |
|
|
Dear All
I have a form one to many
in the many type there are these fields
id,item_type,qty,price
The ID will be already repeated because it is the foreign key
but i want if the item_type is repeated in the same invoice an error message will appear to tell him the item code has been entered before in the same invoice (item_code can not be repeated in the same invoice)
best wishes
|
|
|
Re: Repeat items [message #299161 is a reply to message #299146] |
Sun, 10 February 2008 04:11 ![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) |
bbaz
Messages: 138 Registered: April 2007
|
Senior Member |
|
|
Hi there,
I think that your question is very Vague.
What do you mean One-to-Many relation in your form? Is this a Master-detail Form?
Please provide some screen shots and elaborate more on your problem so that you get the desired response from this forum.
Goodluck,
Baz
|
|
|
|
Re: Repeat items [message #299228 is a reply to message #299146] |
Sun, 10 February 2008 23:33 ![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) |
ashraf_al_ani
Messages: 92 Registered: October 2007 Location: Iraq
|
Member |
|
|
ok no problem with that
but i want to display a message to tell the user there is a problem of repeating the same item_code
best regards
|
|
|
|
Re: Repeat items [message #299315 is a reply to message #299146] |
Mon, 11 February 2008 07:05 ![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) |
ashraf_al_ani
Messages: 92 Registered: October 2007 Location: Iraq
|
Member |
|
|
Dear All
I searched yet and didnt ind any thing
pls I will explain my problem again
i have a details table and its fields are (id,item_code,qty)
(id) is foreign key so it will be repeated with any record according to the master table
the field (id)and (item_code) are combined key
for example
id item_code Qty
1 1 5 (ok)
1 2 4 (ok)
1 1(message will apear telling him that he cant write the item_code again
1 4 100 (ok)
please some one help me ,waiting for your advice
best regards
|
|
|
Re: Repeat items [message #299326 is a reply to message #299146] |
Mon, 11 February 2008 07: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) |
dillango
Messages: 145 Registered: January 2008
|
Senior Member |
|
|
Mr.Ashraf,
I understand from your question that when the user enters the same item in the current form (Tabular form?) it should display an error message.. If it so.. please use the below syntax
and apply in When_validate_item trigger.
declare
mrec number := :system.cursor_record;
mval varchar2(40) := your fieldname
begin
First_record;
loop
if :desig_desc = mval AND mrec <> :SYSTEM.CURSOR_RECORD THEN
message('Same code already entered');
go_record(mrec);
raise form_trigger_failure;
end if;
exit when :system.last_record = 'TRUE';
next_Record;
end loop;
end;
|
|
|
|
Re: Repeat items [message #299819 is a reply to message #299146] |
Wed, 13 February 2008 05:28 ![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) |
ashraf_al_ani
Messages: 92 Registered: October 2007 Location: Iraq
|
Member |
|
|
Dear All
I am sorry for bothering you
but the attached file is a snapshot for the problem
I hope if some one can help me
best regards
|
|
|
|
|