Home » Developer & Programmer » Forms » Form not populating data without pressing F8 (Forms 6i, Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 )
Form not populating data without pressing F8 [message #639100] Wed, 01 July 2015 10:21 Go to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Hello,

I have main database block, CHECK_REQUEST_LIST, created from a FROM CLAUSE.I have another block,LOGIN,related to main block by JOIN. Whenever I open the form, I have to press F8 to execute query. I dont have anything to input, no WHERE clause depending on the input, so why is it not populating itself when opening a form?

Here is my FROM CLAUSE query:
select distinct v.vehicle_id, v.vin1||v.vin2 vin, DECODE(v.request_code,'R','Refund','P','Replacement') type,c.comment_type, v.added_date upload_date,
       a.param_value_descr affiliation, max(text_seq), max(c.added_date) last_update_date, v.comment_id, v.user_id user_id
  from rav_comment_texts c,
      rav_vehicles v,
      rav_co_param_values a
 where v.comment_id = c.comment_id and c.comment_type in ('REF','REPL') and v.check_date is NULL and v.affiliation_ind = a.param_value
   and a.client_code= 'RAV' and a.program_code='RAV' and a.PARAM_CODE = 'AFFILIATION_CODE'
group by v.vehicle_id, v.vin1, v.vin2,v.request_code, c.comment_type, v.comment_id, c.comment_id, v.added_date, v.AFFILIATION_IND, a.param_value_descr, v.user_id


Columns I have on my forms are:
Main block:
vin, type, upload_date, affiliation, last_update_date, user_id
Second block:
user_id.

User_id is coming from the same table,rav_vehicles, in both blocks. I need to change the user_id, but cannot update in first block because it has so many tables involved, so created second block, with just user_id from rav_vehicles, and joined it to first main block.

Other problem is whenever i click on the second block user_id, to change it opens LOV, i pick the one i need, save it, and then the main block is cleared. Again I have to execute query (F8). How do i avoid the main data block from clearing?

Thanks,
rk

[Updated on: Wed, 01 July 2015 11:02]

Report message to a moderator

Re: Form not populating data without pressing F8 [message #639102 is a reply to message #639100] Wed, 01 July 2015 14:03 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

Whenever I open the form, I have to press F8 to execute query. I dont have anything to input, no WHERE clause depending on the input, so why is it not populating itself when opening a form?

Why would it? Did you tell it to do that? If not, you probably should have. How? By executing
execute_query;
in WHEN-NEW-FORM-INSTANCE trigger.

Though, it seems that the master-detail relationship between those two blocks is set in a reverse order. A block that looks like a master (the "second block") should be the "first block" as the "main block" is populated regarding USER_ID set in the master (i.e. "first" block). How to do that? Simply move "main block" below the "second block" in the Object Navigator window.

As of you wanting to automatically execute query when a value is selected from a LoV, you should use the same EXECUTE_QEURY built-in in a trigger attached to that LoV item (it might be WHEN-LIST-CHANGED or WHEN-BUTTON-PRESSED (if you use a button to open a LoV)).
Re: Form not populating data without pressing F8 [message #639103 is a reply to message #639102] Wed, 01 July 2015 14:21 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Thanks for the reply.

I have EXECUTE_QUERY in the WNFI trigger at form level, as well as the block level( CHECK_REQUEST_LIST block which has the FROM CLAUSE ). But it still doesnt populate the data when the form opens up. Only after manually EXECUTE_QUERY (F8), it gets the data.

I dont think i understand your solution for the other part. I am changing the value of the only column USER_ID ( By using LOV pop-up generated by double clicking on the field). After the value is changed, I want to change the same field value for the next record in the CHECK_REQUEST_LIST block. But i get a message box asking to save the changes, and whatever i select YES or NO, the CHECK_REQUEST_LIST block and subsequently LOGIN block, gets cleared. I want to make 5 changes, and then SAVE. How to do that?

Attaching the screenshot. the block with more columns is CHECK_REQUEST_BLOCK where i have FROM CLAUSE, and the one with only USER_ID is the LOGIN block.
Thanks,
rk

  • Attachment: form.jpg
    (Size: 166.17KB, Downloaded 949 times)
Re: Form not populating data without pressing F8 [message #639104 is a reply to message #639103] Wed, 01 July 2015 14:28 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

I am changing the value of the only column USER_ID ... but i get a message box asking to save the changes

That is expected as you are - basically - entering a new value into a data block. If you want to avoid that behavior, you first have to enter query mode (ENTER_QUERY in WNFI trigger or doing it manually), enter value into the USER_ID item (manually or via LoV) and then execute query.
Re: Form not populating data without pressing F8 [message #639105 is a reply to message #639104] Wed, 01 July 2015 14:56 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Yes I understand the expected behaviour, but as I mentioned, I want to avoid saving each record. I want to make 10 changes in the LOGIN block, and then SAVE. Also when i press SAVE or say YES to the message box asking to SAVE THE CHANGES, I want the main block CHECK_REQUEST_LIST , with multiple columns to populate, and reflect the changes i made.

Thanks
Re: Form not populating data without pressing F8 [message #639106 is a reply to message #639105] Wed, 01 July 2015 15:07 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Ah, it seems I misunderstood what you were saying, sorry. That message appears when you navigate between records in the multi-record block. If that's so, what is happening when you navigate to the next record? Is there any (block-level?) trigger (such as WHEN-NEW-RECORD-INSTANCE or similar)? If so, what does it do? Perhaps you should run a form in debug mode and trace its execution, so that you'd see what triggers the annoying "do you want to save changes" message.
Re: Form not populating data without pressing F8 [message #639107 is a reply to message #639106] Wed, 01 July 2015 15:54 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Cannot run in debug mode.

I deleted the LOGIN block. in the main CHECK_REQUEST_LIST block, i made the column USER_ID updateble. Now when i click on that column, it gives pop-up from the LOV. I can click on one of the values in LOV, but it does not get selected, so cannot SAVE. But if i manually type in that column, it does change.
I tried to put COMMIT_FORM in WHEN_VALIDATE_ITEM, POST_CHANGE, ON-UPDATE, but nothing works. So now the problem is : why cant i select from LOV, when i can type in the field instead of selecting from LOV.

Thanks,
rk
Re: Form not populating data without pressing F8 [message #639122 is a reply to message #639107] Thu, 02 July 2015 00:19 Go to previous messageGo to next message
Littlefoot
Messages: 21807
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Quote:

Cannot run in debug mode.

Obviously; Forms 6i doesn't offer that option. Sorry, I really shouldn't discuss anything when I should already be sleeping.

Quote:

I can click on one of the values in LOV, but it does not get selected

Check LoV column mappings. Maybe it is still set on the (deleted) LOGIN block's item.

[Updated on: Thu, 02 July 2015 00:19]

Report message to a moderator

Re: Form not populating data without pressing F8 [message #639160 is a reply to message #639122] Thu, 02 July 2015 08:08 Go to previous messageGo to next message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Thanks.

I got this working, i added the return item as the same column. now it is saving the new value, but now when i want to exit the form, it keeps giving me message box 'DO YOU WANT TO SAVE CHANGES', and whatever option i select, it just brings the same message box asking to SAVE CHANGES again and again. Maybe the block has the query from FROM CLAUSE, and that's why it is not letting me save the changes? If in ON-UPDATE trigger, I put the actual UPDATE statement will it let me save the changes?
Re: Form not populating data without pressing F8 [message #639170 is a reply to message #639160] Thu, 02 July 2015 09:39 Go to previous message
rkhatiwala
Messages: 178
Registered: April 2007
Senior Member
Added the ON-UPDATE trigger, with code to UPDATE the table with the new selected value. it worked. thanks again.
Previous Topic: How to Enable Web.Util Package in Oracle Forms 10g
Next Topic: master-Detail n others
Goto Forum:
  


Current Time: Thu Apr 18 21:29:22 CDT 2024