I am developing a from for sales. It consists of 3 database blocks. 1st one is Master Block, 2nd one is Detail1 Block and 3rd is also Detail2 Block.
Relationship is as follow Master -> Detail1, Master -> Detail2
I am using Trigger When Create Record at Master Block for creation of new record and assigning new Sale No in Master Block.
There is NO problem when there is no discount (which is the item of Detail2 block) and I save the form then it is OK (when user do not enter the data in discount item of Detail2 block).
The problem is when there is discount (which is the item of Detail2 block) and after entering discount, User SAVE the form then it saves the 3 records (Master, Detail1 and Detail2) and new Sale No is assigned in Master Block,
but after that cursor still remains in Detail2 item (Discount) instead of going to Customer item in Master block which is next item after Sale No.
The Cursor should be in Customer item of Master Block instead of Discount item of Detail2 block.
I am using Oracle Developer 6i, Database 10g (10.2) on Windows XP Professional.
When I Run the Form, at Form level in When New Form Instance Trigger,
I have used Execute_Query and Last_Record. Everything Runs fine here.
But One thing is missing and that's the Name of the Customer
(which is a Display Item in Master Block) but Customer ID is displayed.
There is separate table for the customer. Only Customer ID is stored in
Master block table.
I want to Display the name of Customer when the query is executed by matching the Customer ID and then fetching the relevent name from the customer table.
I have tried Post Query and When Validate Item but only got error (ORA-01422).
I don't know what you did in the meantime, but - if you did "nothing", then you can expect ORA-01422 again (it is the TOO MANY ROWS error) - query is written in a way that it doesn't return a single value into a form item. For a certain customer ID, that might happen again unless you fix (fixed) it.
As of triggers you used: WHEN VALIDATE ITEM is needed when creating new records (or updating existing ones), POST-QUERY is used while querying existing data. So - no objections here, that's exactly what you needed to use.