This discussion is archived
3 Replies Latest reply: May 10, 2013 6:34 AM by CraigB RSS

Need to get record status

943601 Newbie
Currently Being Moderated
Hi All

I have a below requirement...
Normally i have 3 blocks. One is master block and remaining blocks are details blocks(in different tabs).
I can do query in all the blocks for the sake of fetching records.

If i selected the record in detail block and tried to get the query mode it needs to perform the query in details block. It is working fine.
If i didn't select any particular record in detail block and tried to get the query mode it needs to perform the query in master block. But here cursor is coming to detail block, and querying detail block when i did query.

Requirement:
Here i need to get the record status in detail block level. If the record is in selected status it should perform query in detail block, else cursor should move to master block level.

I am not able get the record status in detail level.

Can any one help on this?
Thanks in advance.

With warm regards
Hari

Edited by: 940598 on May 9, 2013 5:42 AM

Edited by: 940598 on May 9, 2013 5:44 AM

Edited by: 940598 on May 9, 2013 5:56 AM
  • 1. Re: Need to get record status
    CraigB Guru
    Currently Being Moderated
    I am not able get the record status in detail level.
    What have you tried? Can you prove a code sample? Also, what Forms version are you using?

    Did you check the :SYSTEM.RECORD_STATUS variable? This system variable will give you the status of the current record.
    Requirement:
    Here i need to get the record status in detail block level. If the record is in selected status it should perform query in detail block, else cursor should move to master block level.>
    What do you mean by, +"If the record is in *selected* status..."?+ The values for RECORD_STATUS are: CHANGED, INSERT, NEW, and QUERY. I'm going to guess that when you say "selected" you mean "query".

    I'm really not sure of what you are trying to do. It sounds like you are trying to synchronize a detail block with a master block. If so, this is what Block Relationships are for.

    Can you please elaborate on what you are trying to accomplish?

    Craig...
  • 2. Re: Need to get record status
    943601 Newbie
    Currently Being Moderated
    Hi Craig

    Thanks for your quick reply.

    I am using form 6i for my form development.

    Issue Description:

    When i try to query the field first time in Master block level, it will fetch the data both Header Block and Details block. As well as cursor point will be in both Mater and Detail Blocks level.

    When i try to query second time without selecting(Placing the cursor) any field in both blocks it is automatically querying Detail level Block (All Detail block records in read only mode).
    But it should query Master Level Block. Detail block has to perform query only when we select (Place cursor) the record in Detail Block.

    Answers for your questions:

    Can you prove a code sample?:

    I have used the below code in detail block level to move cursor from one block to in another block.

    When new Block instance:

    IF :SYSTEM.RECORD_STATUS = 'QUERY' THEN -- tried with 4 record status which you have provided
         GO_BLOCK ('XX_INV_SERV_DEMA_STG'); -- XX_INV_SERV_DEMA_STG is the detail block name
    ELSE
         GO_ITEM('XX_INV_ITEM_ELEMENTS_V.ITEM_NUMBER'); -- XX_INV_ITEM_ELEMENTS_V Master block name.
    END IF;

    The above query is not working fine.

    Requirement:
    When i try to query second time it should perform in master level block. Not in detail level block.

    Please reply for this requirement

    Thanks in advance.

    Regards
    Hari.

    Edited by: 940598 on May 10, 2013 5:22 AM
  • 3. Re: Need to get record status
    CraigB Guru
    Currently Being Moderated
    Hari,
    When i try to query the field first time in Master block level, it will fetch the data both Header Block and Details block.
    How do you perform this query? Did you write code or are you using the Enter-Query/Execute-Query function keys?
    When i try to query second time without selecting(Placing the cursor) any field in both blocks it is automatically querying Detail level Block (All Detail block records in read only mode).
    Again, how are you performing this second query (code or function key)?

    If you have written code - is this just the code in your When-New-Block-Instance trigger or do you have another trigger as well?

    If function key - then I would recommend you create a Module level Key-EntQry trigger that checks which block you are in and move the navigation cursor to the Master block before calling the Execute_Query() builtin.

    Hope this helps.
    Craig...

Legend

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