|
select gbh.batch_no,
msi.segment1 || '-' || msi.segment2 || '-' || msi.segment3,
msi.description,
mr.lot_number,
mr.subinventory_code,
mr.RESERVATION_QUANTITY
into
&p_doc_no,
&p_item_desc,
&p_desc,
&p_lot_no,
&p_sub_inv,
&p_resrv_qty
from
gme_batch_header_vw gbh,gme_material_details gmd,mtl_reservations mr,mtl_system_items msi
where gbh.batch_id=gmd.batch_id
--and gbh.batch_no='AR02072'
and gmd.line_type=-1
and gmd.material_detail_id=mr.demand_source_line_id
and msi.inventory_item_id=gmd.inventory_item_id
and msi.organization_id=gmd.organization_id
and mr.lot_number is not null
and :rowid=mr.rowid
The table is mtl_reservations the trigger is update...
The thing is that on update it is sending correct notification but on insert it is just throwing multiple notification however it should not send becasue i did not set alert on insert.
What is happening in the query is whenever the batch is autodetailed the lots are populated in mtl reservation table. But when user manually change the subinventory, lot or quantity reserved it should send alert...
The other alert we need is on insert when mutiple entries are done in resrevation means two lots or three lots than alert is fired. this is the second alert we need.
My alert is also firing on insert even when i did not set my trigger to insert.
I am also looking at the document you have provided.
Thanks and Regards,
Saad
|