This discussion is archived
8 Replies Latest reply: Jan 14, 2013 1:57 AM by 920719 RSS

Issue updating  data in Forms

920719 Newbie
Currently Being Moderated
Hi Friends,
I have developed a Master Detail form. Block A has the header record based on Table A, Block B has the detail records based on Table B. I am able to insert the record into A and B. But When i query the records and try to update the data in block A I am not able to update it. However I am able to update/add data to the block B. When I try to enter anything in any of the field or select any LOV in Block A nothing gets written into the fields. The data is not changing at all. It is just as it is.

When I try to update something in any field the SYSTEM.RECORD_STATUS is not changing to UPDATE or CHANGED. It is still in QUERY status

Can someone tell me why this happens.

Thanks

Edited by: 917716 on Jan 7, 2013 11:10 PM
  • 1. Re: Issue updating  data in Forms
    HamidHelal Guru
    Currently Being Moderated
    Hi,
    Always mention forms and database version when you ask any question.
    do you have any trigger written in block A, like W-New-Record-Instance or post query ?
    if yes what is the code ?

    And check the Block A "*Update Allowed*" Property is Yes /no. If no make is Yes.

    Hope this works...

    Hamid
  • 2. Re: Issue updating  data in Forms
    920719 Newbie
    Currently Being Moderated
    Hi Hamid,
    Forms 10g, DB 11g.
    Yes I have triggers in block A, When New-Record-Instance, but No POST-QUERY. The New Record Instance trigger does not do much other than populating some fields that are hidden.

    The Block A Update Allowed property is set to Yes.

    The strange thing is when I try to enter something in the field it does not get typed also. The same value which is earlier existing in that field is retained and for fields with no value I am not able to enter anything.

    I see a message FRM-40654. Record has been updated by another user. Re-query to see change.

    Is there a way to find out what fields have changed. Again the record_status is still QUERY

    Thanks

    Edited by: 917716 on Jan 8, 2013 12:16 AM
  • 3. Re: Issue updating  data in Forms
    HamidHelal Guru
    Currently Being Moderated
    917716 wrote:
    Hi Hamid,
    Forms 10g, DB 11g.
    Yes I have triggers in block A, When New-Record-Instance, but No POST-QUERY. The New Record Instance trigger does not do much other than populating some fields that are hidden.
    Ok.

    If there is only one trigger in block A, make the code as comments / or block the code not to work and test. if more trigger make the code as comments.. then test.

    Hope you will find out the problem.

    Hamid
  • 4. Re: Issue updating  data in Forms
    920719 Newbie
    Currently Being Moderated
    Hi Hamid,
    Thanks

    I fixed the issue with the on lock trigger on the block. But not able to understand why this should be written. Any idea why this should be written. Can someone explain.

    Thanks
  • 5. Re: Issue updating  data in Forms
    user346369 Expert
    Currently Being Moderated
    I fixed the issue with the on lock trigger on the block.
    What?!!! Why do you even HAVE an on-lock trigger? On-Lock should be used only in very special and unique situations. What are you trying to do there?

    And how are you populating your block? With a SQL select, or using Execute_Query?
  • 6. Re: Issue updating  data in Forms
    920719 Newbie
    Currently Being Moderated
    Hi Steve,
    I am using the Execute_query to populate the records in the block. I was not able to edit the fields after they are inserted for the first time. I had this on lock written with null on the block and it works. I am completely perplexed at what is happening here.

    Any Idea???

    Thanks
  • 7. Re: Issue updating  data in Forms
    user346369 Expert
    Currently Being Moderated
    By writing NULL; in the on-lock trigger, you are wiping out the very important row-locking process that Forms automatic processing does with every form you write. Delete that trigger!

    Using execute_query to populate the block is the correct thing to do with your block. The fact that you are getting the error when you try to change data in the block indicates something else is wrong.

    Do you also query this data into another block in the form? Or have you changed the database block properties on the block in the form, so it is not using standard row locking? --- not sure, but messing around with properties like "Enforce Primary Key" and others may cause this. Set that property to No, and don't identify primary key fields in your block. The rowid is the key Forms normally uses.

    I've not used master-detail blocks much, so I am not sure what the ideal setup is between the master and detail records and identifying key fields. If you describe what you have, maybe others can help.
  • 8. Re: Issue updating  data in Forms
    920719 Newbie
    Currently Being Moderated
    HI Steve,
    No I have not tampered with the properties of the block. I am not querying the details of this block in a different block either. I am surprised that when I try to edit the existing values I am having to encounter this error. I have checked all the database columns in the form and the table to check if something has changed but no.

    The Enforce Primary Key is set to No. Any hints on finding what I am doing wrong?

    Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points