Home » Developer & Programmer » Forms » restrict user to enter serial numbers of a product in 3 level block (form 6i, oracle 10g)
restrict user to enter serial numbers of a product in 3 level block [message #552233] Tue, 24 April 2012 07:36 Go to next message
nasir_mughal
Messages: 122
Registered: April 2007
Location: Karachi
Senior Member
Hi

I have a sale invoice form with 3 data blocks.
Data block 1- master_blk : For date/customer of sale invoice
Data block 2- detail_blk1 (detail of the master block - For products and qty)
Data block 3- detail_blk2 (detail of DETAIL_BLK1 For entering serial numbers of products)

My requirement is that whatever quantity user enter in data block 2 against each product he must enter equal number of serial numbers of that product in data block 3.

For this I have created on item (cnt_iteml : to count product's serial numbers in block3 ) in data block 2, and on summary item (t_serial_no ) in block3.

Whenever user changes in quantity, cnt_iteml: item is populated with t_serial_no in block3 of that product by following trigger on quantity column.

POST-Change Trigger ( quantity column )
:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;


Following trigger is written on block level at data block-3 to populate cnt_iteml with t_serial_no.
PRE-RECORD

IF GET_BLOCK_PROPERTY('SERIAL_NUMBERS',STATUS) IN ('CHANGED') THEN
:stock_transactions.cnt_itl:=:serial_numbers.t_serial_no;
END IF;


Above triggers are fulfilling my requirement except following condition.

If user after entering serial numbers in block 3 and without saving goes back to block2 and try to navigate to another record he gets a message asking him to save changes by forms. At this time if user presses no then cnt_itl item is not been populated with t_serial_no item's value.

What I want in above condition is that if user was inserting new record cnt_it item should be populated with 0, so that he shouldn't be able to save this record. And If he was updating then cnt_itl item should be populated with actual no of records in database against that product.

Kindly help me.



Re: restrict user to enter serial numbers of a product in 3 level block [message #552247 is a reply to message #552233] Tue, 24 April 2012 09:27 Go to previous messageGo to next message
chandan.rattan
Messages: 84
Registered: December 2008
Location: India
Member

Nasir,

What I want in above condition is that if user was inserting new record cnt_it item should be populated with 0,

As per above requirement, You can assign the cnt_it :='0' in when-new-record-instance trigger.
Re: restrict user to enter serial numbers of a product in 3 level block [message #552248 is a reply to message #552247] Tue, 24 April 2012 09:44 Go to previous message
nasir_mughal
Messages: 122
Registered: April 2007
Location: Karachi
Senior Member
I tried this but It didn't work.
Previous Topic: IS Oracle Forms/Reports 4.5 supported on database 9i?
Next Topic: Receiving Form
Goto Forum:
  


Current Time: Fri Jul 05 21:29:40 CDT 2024