Receiving Form [message #551908] |
Sun, 22 April 2012 05:09 |
|
furqan
Messages: 115 Registered: January 2012 Location: Hyderabad
|
Senior Member |
|
|
hi all
i have master-detail form which i use to send and receive material.
sending is working fine.in between send n receive i have a pending form which displays records where receive has not been done.
when i double click on bill_id in pending form, receiving from is called and
all master item are appearing through globals in master and iam just entering
receiver id and name and executing query which displays all the send items in detail form with rec_qty blank.enter rec_qty and save.in detail table only rec_qty is getting updated..Good..but when user receive quantity less than send qty is problem.i want to update rec_qty next time when use receive remaining qty with + with previous rec_qty in detail table.
i tried update using
declare
v_count4 number;
begin
select count(*) into v_count4 from ship_dtl
where bill_id=:ship_mstr.bill_id and
mat_code=:ship_dtl.mat_code and
send_qty is not null;
if v_count4 = 0 then
update ship_dtl set
rec_qty=nvl(rec_qty,0)+nvl(:ship_dtl.rec_qty,0);
end if;
end;
on rec_qty(when validate item)its not working
help..!!!
[Updated on: Sun, 22 April 2012 07:52] Report message to a moderator
|
|
|
|
|
|
Re: Receiving Form [message #552018 is a reply to message #551970] |
Mon, 23 April 2012 03:41 |
|
furqan
Messages: 115 Registered: January 2012 Location: Hyderabad
|
Senior Member |
|
|
create or replace trigger bu_qty
before update on ship_dtl
for each row
begin
:new.rec_qty := :old.rec_qty + :new.rec_qty;
end;
i created trigger as said.but now rec_qty is not getting inserted in table.when i check table rec_qty is showing blank.i tried to update rec_qty through query,it saying 1 row updated but then also is showing blank.
thanks
[Updated on: Mon, 23 April 2012 03:45] Report message to a moderator
|
|
|
|
|
|
|
|
Re: Receiving Form [message #552209 is a reply to message #552066] |
Tue, 24 April 2012 06:11 |
|
Hi Furgan.....See as what i have understood from above....I think u need to insert the records which user is receiving other day. I mean as per u "after a day he receive another 2,so again he will enter 2 and save it.so rec_qty on that particular record should become 4.but its not doing so.its overwriting the old value with new value..with summing it up."
U might be updating with existing records, then only it must be happening.I think u need to insert the other 2 records. If u need more help, You can PM me.
|
|
|
|
Re: Receiving Form [message #552296 is a reply to message #552216] |
Tue, 24 April 2012 23:50 |
|
furqan
Messages: 115 Registered: January 2012 Location: Hyderabad
|
Senior Member |
|
|
thank a lot....!!! really thank you....
it got solved and works fine at the movement.
i really thank you all for your kind help and interest in my topic.again thanks a lot....
|
|
|