Home » Developer & Programmer » Forms » in which trigger I should use this:
in which trigger I should use this: [message #193175] Fri, 15 September 2006 03:00 Go to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I have 2 table
both table have a same field "Quantity".
I am unsing this formula pla help me in where and in which trigger I should use this:
*************************
declare
pos number;
rcs NUMBER;
tot number;
begin
select sum(quantity) into pos from subpogeneral where subpogeneral.item_code=:subrcgeneral.item_code;
select sum(quantity) into rcs from subrcgeneral where subrcgeneral.item_code=:subrcgeneral.item_code;

--tot := pos-rcs;
if pos >500 then
--< rcs then
--M:= SHOW_ALERT ('MSG');
message('P.O Quantity is less then RC Quantity! ');
message(' ');
raise form_trigger_failure;
end if;
end;

Re: in which trigger I should use this: [message #193179 is a reply to message #193175] Fri, 15 September 2006 03:11 Go to previous messageGo to next message
Liza79
Messages: 74
Registered: September 2006
Member
seems to me some kind of validation, but intill i don't know the actual purpose of this formula, why did you write it and when do you want this check to be performed. I cann't suggest you.

It must be in WEHN-VALIDATE-OBJECT trigger, but which one, i cann't tell you unless you tell me what i asked?

Liza
Re: in which trigger I should use this: [message #193192 is a reply to message #193179] Fri, 15 September 2006 04:30 Go to previous messageGo to next message
kamran.it
Messages: 265
Registered: September 2005
Location: Karachi
Senior Member
I wrote in when-validate-item
but not working in this trigger and I also used this in pre-insert of block
Re: in which trigger I should use this: [message #193405 is a reply to message #193175] Sat, 16 September 2006 05:57 Go to previous messageGo to next message
Liza79
Messages: 74
Registered: September 2006
Member
not working in the trigger, what do you mean, its giving any error, or not just working?
Re: in which trigger I should use this: [message #193495 is a reply to message #193175] Sun, 17 September 2006 20:02 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

Are you sure the condition was satisfied?
icon2.gif  Re: in which trigger I should use this: [message #193517 is a reply to message #193175] Mon, 18 September 2006 01:39 Go to previous messageGo to next message
shahidmughal
Messages: 91
Registered: January 2006
Location: Faisalabad Pakistan
Member

Salaam o Alaikum
Mr. Kamran

Your Procedure is ok.

You can Use this trigger

in the following places

1. post-query
2. when-validate-item
3. key-next-item
4. post-text-item

and some others
But you should use trigger in

When-Validate-Item

Regards.

Muhammad Shahid Mughal

Database Application Developer
From Faisalabad
Re: in which trigger I should use this: [message #193784 is a reply to message #193192] Tue, 19 September 2006 07:04 Go to previous message
sandeepk7
Messages: 137
Registered: September 2006
Senior Member

Use When-Validate-item
and set validation unit to item level , if you want to restrict user at the same time enerting the quantity.

Sandy

[Updated on: Tue, 19 September 2006 07:05]

Report message to a moderator

Previous Topic: Form query
Next Topic: Copy/Paste by Trigger
Goto Forum:
  


Current Time: Fri Sep 20 10:34:28 CDT 2024