Unanswered: Blank Line getting generated on the save button of the form
I am working on Oracle forms 6i.
I am getting a problem when I am trying to save the value in the form.
Well the scenario is like this:
I have got a multi record block. In that block there are two items jobno and inoivce no. Both the items have an LOV attached to them giving jobnos and invoice nos respectively.
This is on the '*ORIGINAL_BLOCK*'.
The problem perists with the jobno field. In the LOV for jobno, the 'column mapping properties' property, the return item section has original_block.jobno as the value. The code to fetch the details about the jobno (like vendor no,vendor site,invoice no etc) has been written on the When-Validate-Item trigger. I am also updating the WHO colums(like created by,created date,last upated by, last update date) on the Pre-Insert trigger at the block level. This whole thing of fetching the records is working fine. But when I simply press the save button an extra blank line gets generated on the form as well as at back end with jobno like this:
A same jobno can have multiple number of invoices. So the lines getting generated are - number of lines + 1(unrequired entry).As in the above scenario there are only 2 invoices for the same job and a third unrequired entry getting generated. If there are 3 invoices I get 4 lines (3 required + 1 unrequired blank entry).
So to solve this issue I added a button 'Add JOB'. I took another '*NEW_BLOCK*',designed another canvas and and added an item on it containing a dummy jobno field and attached an LOV to that item. Then the same When-Validate-Trigger to that item fetching the details. so when I press the button 'Add JOB' using show_canvas and go_item(dummy_job_item) I navigate to that new canvas, select the jobno there from LOV, fetch the details. Now I wrote execute_query on KEY-EXIT of the NEW_BLOCK so that whatever are the fetched details, they would go on the ORIGINAL_BLOCK.jobno and respective details in resp fields. But this did not work.So I wrote execute_query on the When-New-Block-Instance of the ORIGINAL_BLOCK and it worked.
But now what is happening is when I open the form once again after closing the form, all the back end data is appearing on the form i.e. when I open a new form session everytime. But I want the form to be clear with no entries displayed whenever I open the form.
I understand the question is lengthy and tricky. Apologies for that. But had to elaborate it, to get across the problem.