Re-sequencing records in a multi record block

I have a multirecord block with sequence No field which is unique no and other fiels which is showing from the values which I have stored in a table say sequence No from 1 to 10 along with other fields.If I change the record which has the sequence No say 6 to become seq no 2 ,then the record with seq no 2 should become seq no 3 and the rec with seq no 3 should become seq no 4 and rec with seq no 4 should become seq no 5 and rec ord with seq no 5 should become seq no 6.This should automatically happen when the user changes say
seq no 6 to seq no 2 .User may change any seqq no like this.
We will provide 2 text box serialNo from and Serial No 2 and a button click should swap the records in between this two seq no and show it on the screen in the multi record block.Please help me to code this.
Regards
Jayshree Suresh

User455091,
1- You can add a non based checkbox item to your block. To resequence a record, you may have to check the record you want to change and then, check the position you want to change it for. Example: if you want to change the 6th to seq 2, you check the record 6 and check the record 2 right after (you can choose any logic to implement your sequence change. this is only an example).
2- When you check the first record, set a global variable "seq_from" with the value of the sequence field (or :system.cursor_record if the block is ordered by this sequence)
3- When you check the 2nd record, set a global variable "seq_to" and proceed to the resequence.
4- Manage the change down and change up (if "seq_from">"seq_to" or "seq_from"<"seq_to")
5- You have to change the values of all the record fields for all the records between seq_from and seq_to. by doing a loop between seq_from and seq_to. You may have to use previous_record or next_record depending on if it is a change_qown or a change_up.
6- When the resequence is done, reset all the variables to blank, and don't forget your checkbox!
This seems difficult, but only think about it. It is easier than what you expect. This method is more user-freindly but, just think about it....

Similar Messages

  • Single record in a multi record block

    How do I disable a single record in a multi record block keeping only the display option in Forms 4.5

    you can't in 4.5 you can do it in 6.0 with the set_item_instance_property.

  • Copy the Last Record queried to the new record in a Multi - Record Block

    Hi Team
    When i enter a new record in a Multi - Record Block the last record should get copied to the new record.
    Please help me.
    Thanks

    Hi
    pls use...
    DUPLICATE_RECORD;Amatu Allah

  • Conditionally display an icon for each record in a multi record block

    Hi,
    I am using Forms 6i. Is there any way to conditionally display an icon for each record in a multi record block. The SET_ITEM_INSTANCE_PROPERTY builtin does not have many choices. Thanks for your help.

    Henry,
    I doubt that. You would have to replace the text item with an image item. This however can't be done for individual cells in a table but only for the whole column.
    On the web chances are that these could be handled with a custom PJC, but this solution doesn't work in client/server
    Frank

  • Get the first item value of previous record in a multi record block

    Hai,
    I have a multi record block with four items.I should get the first item value of the previous record so that I can increment its value in the current record.
    Thanks.........

    If you want a distinct value in each row or to be able to retrieve the records in the same order they were written then you should use a sequence.
    If you want to retrieve the records in the same order they were created in the block then you will need a diffferent solution to the one you outline here since a user could enter a new record between two others.
    I posted this a while back in response to someone who was using a sort_key item and resetting it for each row when a new record was inserted:
    If you make the sort_key bigger then you have much more room to insert new rows in between existing rows without having to reset all the sort_keys.
    Eg. you have rows with sort_keys of 129282000000000000 and 129283000000000000 (you can have more zeros if you want) and you want to insert a row in between. if you're using oracle forms then the user would have to click on the first of these rows and then do 'insert'. in your insert process you would store the sort keys of the current record and the one below, create a blank record in between and set the sort_key of that record to the average of the other two. you will be able to insert many new rows in between the original 2 before running out of space in the sort_key field.
    the method above is not sufficient, there are some other cases to consider:
    1) when the user is on the last record of the block then you will just create a new record with sort_key set to a greater number than the row before. you can have the sort_key defined as number(38) and to safely allow you to enter 1000 rows each new row would normally be 10E33 greater than the previous one.
    2) when the user is entering the first record then just set the sort_key to 10E33.
    3) on the off-chance that you do insert a great number of records and cannot insert another in between then you would need to alert the user, process the records so that the sort_keys are evenly spaced and requery the block. this processing could be scheduled nightly to make this eventuality even less likely.
    4) make sure the user cannot run the default 'clear_record' procedure. this would break my method as well as yours!
    James.

  • Return amount of records after query multi-record block

    Hello,
    I would like to have a restriction in my multi-record form that counts the amount of returning records (after execute_query). If the amount is >= 1000 then I have to raise an error.
    How can I implement this?
    Best regards,
    Ronny.

    It most cases forms doesn't return all rows to the user in a batch unless the block property Query-all is set to yes. But if you have sum items based on that block, you have to set it to Yes. If you can turn this flag off and change the Query Array Size (block property) to 0 or something small (like 20), you dont have to worry about how many rows the query is going to return.
    In you case, sounds like you want the user to put more constraints if rows returning > 1000 and you probably dont want the user to ever look those rows. You can do a
    select count(*) from your_table
    where --your critera
    and rownum < 1001
    before execute the query. But this select might take
    a while if you table is very big in oracle 9i.
    The easiest thing is to turn off the Query-All switch, let the forms handle the query and let the user decide whether to refine the query.

  • Fetching the number of records in a multi-record block...

    Hi ,
    In Forms10g runtime-and in previous releases too- there is , as a message, the number of records fetched/inserted in a multi-line block such as Record:5/9. Is it possible to catch these two numbers (i mean 5 and 9 , or at least the number of records)...not only in query but in the insert mode as well...?????
    Many thanks ,
    Simon

    No, you can't capture that text, but you can write your own code to do the same thing.

  • Deleting selected record in a multi-record block

    I am using Form 6i.
    I have two multi-record block viz. BLK_A and BLK_B.
    BLK_A has record displayed property set to 4
    BLK_B has record displayed property set to 8
    Each block has checkbox item.
    BLK_A contains records retrieved from table after entering data in selection criteria.
    When checked on anyone checkbox of BLK_A, then it displays related information in BLK_B.
    But when I uncheck the checkbox of BLK_A, then how to delete records in BLK_B.
    Thanks in advance.
    Regards,
    Vikas

    No, absolutely not.
    I cannot use this method.
    Because if two checkbox is check in BLK_A, then records related to both record in BLK_A will display in BLK_B. If I uncheck any one checkbox of BLK_A, then only records related to that checkbox should be deleted.
    If I use your suggestion, then all data will be removed.
    Thanks and regards,
    Vikas

  • How to set default settings to display record count in multi record block

    Hi All
    Whenever I query my multi record block, I get 1/? as record count at the console in standard Oracle Applications. Is there any setting so that it displays 1/50 (in case total record queried is 50). I don't want to set query all property of block as I don't have any control in standard Apps forms.
    Thanks in advance
    Navdeep

    Check out the next_navigation_item option for the get_item_property procedure. If you use this you can do the process without having to navigate from one item to the next.
    You can do something like this (untested) to move and resize the items (other than the first in the block):
    PROCEDURE move_and_resize(p_item IN ITEM, p_width IN PLS_INTEGER) IS
      prev_item ITEM := Get_Item_Property(p_item, PREVIOUS_NAVIGATION_ITEM);
    BEGIN
      Set_Item_Property(p_item, WIDTH, Get_Item_Property(p_item, WIDTH) + p_width);
      Set_Item_Property(p_item, X_POS, Get_Item_Property(prev_item, WIDTH) +
                                       Get_Item_Property(prev_item, X_POS));
    END move_and_resize;
    move_and_resize(myitem, -30);

  • How to get the original record Number in Multi-Record Block

    Hello Everyone,
    I know how to find the duplicate item in the multi-Record block,
    For Ex:
    Line_Num            Item_Name             Quantity
    1                           AA                      10
    2                           BB                      20
    3                           AA Here 3rd record Item_name is duplicated, I can able to check and display the message that 'Item is duplicated' ,I found from [sheikyerbouti.developpez.com/duplicates/duplicates.htm] .
    but I want to show along with original line number i.e 1 when the item_name is entered .
    Here I want to check the original Line_Num and want to display the message
    'Item is duplicated,Update quantity in Original Line 1'
    Can anyone help me to get this?
    Thank You.
    Regards,
    Guru.

    Hi Francois,
    Actually I want to check and show the message when the item_name is entered i.e WHEN-VALIDATE-ITEM TRIGGER.
    I put the following code in WHEN-VALIDATE-ITEM TRIGGER
    Declare
         curnum number;
         dupnum number;
         cur_item varchar2(100);
         v_alert_no number;
         p_linerec varchar2(100);
    Begin
    curnum := TO_NUMBER(:System.Trigger_Record);
    cur_item := :Lines.Item_number;
    First_Record;
    p_linerec := :Lines.Item_number;
    LOOP
    If p_linerec = cur_item then
         dupnum := :Lines.Line_num;
         set_alert_property('ALERT_STOP',ALERT_MESSAGE_TEXT,
    'Duplicate Item Found,Update QTY in Original line number '||dupnum);
       V_ALERT_NO := show_alert('ALERT_STOP');
       :LINES.ITEM_NUMBER := NULL;
    :LINES.ITEM_DESCRIPTION:= NULL;
    :LINES.ITEM_REVISION:= NULL;
    :LINES.ITEM_CATEGORY:= NULL;
    elsIF (:System.Last_Record = 'TRUE') THEN
         Go_Record(curnum);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP;
    End; But I am getting the following error,
    FRM-40737:Illegal Restricted Procedure
    FIRST_RECORD in WHEN-VALIDATE-TRIGGERand then
    its showing for first line itself.
    Duplicate Item found.Update QTY in Original line number 1so I put the condition
    If :Lines.Line_num > 1 then --Only to check when the block having more than one record.but now it checking from second record and displaying,
    Duplicate Item found.Update QTY in Original line number 2 --(instead of Update QTY in Original line number 1)Can you tell me how can I change the above code for my requirement?
    Thank you.
    Edited by: Gurujothi on 27 Mar, 2013 5:20 PM

  • How I can Change records color in multi record block

    Hi,
    I am using Form 6i, No. of records displayed 15 in a block EMP, now at run time I want to see that employees who belong to dept No. 10 , their records color is RED.
    And employees who belong to dept No. 20 , their records color is BLUE
    And employees who belong to dept No. 30 , their records color is GREEN
    Pleased send me the solution on urgently basis. If possible send FMB file of this problem solution to me. E_Mail: [email protected]
    Best regards,
    Shahzad

    Hi,
    this shouldn't be a problem with use of VISUAL_ATTRIBUTES, post_query trigger and SET_ITEM_INSTANCE_PROPERTY built_in:
    steps:
    1) create VISUAL_ATTRIBUTES
    2) in post_query of block use Set_Item_Instance_Property built in
    SET_ITEM_INSTANCE_PROPERTY(item_id ITEM,
    record_number NUMBER,
    property NUMBER,
    value VARCHAR2);
    example from Forms documentation for use of set_item_instance_property is
    Set_Item_Instance_Property( cur_itm,
    CURRENT_RECORD,
    VISUAL_ATTRIBUTE,
    'My_Favorite_Named_Attribute');

  • Auto skip to the next record in a multi-record defined text item

    I know that by setting the autoskip property to true, this
    allows the cursor to navigate to the next item defined in a
    block without having to press return, tab or click w/a mouse
    into the next item. What I would like to do is emulate that
    behavior using a single multiple record text in a block. In
    other words, I want the form to navigate to the next record for
    that item automatically, without having to hit the down-arrow
    key or mouse-click to the next record or whatever.
    Anyone know if that's possible?

    hi
    you can try in this way. you can set block property 'navigation
    style' to 'change record'.

  • How to do validation on multi record block at run time...

    Dear Friends,
    I have to do validation at run time on multi record block.
    If user tries to enter and save two or more records in same multi record block with same data at run time, it should not allow it and display a message like, " error : Records are having same(duplicate) values. "
    I already did validation with the data coming from database table using cursor. But confused about how to do at run time(on one screen only) ??
    Please, give details about how to check duplicate records on form block before saving it to the table ????
    Regarding details would be greatly helpful.
    thanks,

    Hi...Pankaj
    thanx for your reply..
    I already did validation for the data coming from table....
    but I need to do it on form only...at run time...
    exa...
    In one multi record block
    record no : column 1 : column 2 : column 3
    1 abc 123 hi
    2 abc 123 hi
    so it should check on the form itself, here I m not getting data from table...I am just
    navigating from first record to second using down arrow.
    so, may be 2 possibilities.
    1) when user navigates using tab to third record, it should say like two duplicate records.(may be like when validate record or item)
    2) or when user tries to save, it should say two duplicate records.
    so, everyting should take place on form screen only.....
    waiting for your reply,
    thanx...

  • Oracle Forms - need to update multi-record block - Help needed asap

    Hi,
    We are using Oracle apps release 11i - Oracle forms 6i.
    I have a field "project_start_date" in project_block in a custom form. There is another multi-record block called role_block in the same custom form and it has a field named start_date. Requirement is when ever I make change in the project_start_date in project_block, that should reflect in role_block.start_date. I tried different means and could update only the very first record of the multi-record block - role_block. I need to update all the records in the role_block with the same project_start_date. Used looping and several other methods. But could not achieve. Any help is really appreciated.
    Thanks
    Akil

    Hi;
    For your issue i suggest close your thread here as changing thread status to answered and move it to Forum Home » Application Development in PL/SQL » Forms which you can get more quick response
    Regard
    Helios

  • Problem in displaying records in multi record block

    Hi all,
    I have a problem in displaying records in a multi record block in a form.
    I have 1 control block and 1 data block(multi-record block).
    Control block has one item CUSTOMER-ID. Data block has many other items related to customer.
    when a value is entered in customer-id text item, all the relavant details should be displayed in the data block.
    but, the records are overlapping in the same line in the data block, actually they have to be displayed one record per one line.
    The code is,
    IF :CUST_BLOCK.CUST_ID IS NOT NULL THEN
    GO_BLOCK('XBSI_CONTRACT_PRICE_FACTORS');
    FOR C1 IN C
    LOOP
    :XBSI_CONTRACT_PRICE_FACTORS.CUST_ID:=c1.site_use_id;
    :XBSI_CONTRACT_PRICE_FACTORS.CAT_ID:=c1.ipc_category_id;
    :XBSI_CONTRACT_PRICE_FACTORS.MFG_ID:=c1.mfg_category_id;
    :XBSI_CONTRACT_PRICE_FACTORS.INVENTORY_ITEM_ID:=c1.inventory_item_id;
    :XBSI_CONTRACT_PRICE_FACTORS.PRICE_BASIS:=c1.price_basis;
    :XBSI_CONTRACT_PRICE_FACTORS.PRICE_FACTOR:=c1.price_factor;
    END LOOP;
    Please help me out..
    Thanks in advance!
    Suman

    Hi Suman
    IF :CUST_BLOCK.CUST_ID IS NOT NULL THEN
    GO_BLOCK('XBSI_CONTRACT_PRICE_FACTORS');
    first_record;
    FOR C1 IN C
    LOOP
    :XBSI_CONTRACT_PRICE_FACTORS.CUST_ID:=c1.site_use_id;
    :XBSI_CONTRACT_PRICE_FACTORS.CAT_ID:=c1.ipc_category_id;
    :XBSI_CONTRACT_PRICE_FACTORS.MFG_ID:=c1.mfg_category_id;
    :XBSI_CONTRACT_PRICE_FACTORS.INVENTORY_ITEM_ID:=c1.inventory_item_id;
    :XBSI_CONTRACT_PRICE_FACTORS.PRICE_BASIS:=c1.price_basis;
    :XBSI_CONTRACT_PRICE_FACTORS.PRICE_FACTOR:=c1.price_factor;
    next_record;
    END LOOP;
    Try this. you are trying to show all the records in same line. so its overlapping.
    Thankyou
    [email protected]

Maybe you are looking for

  • How to find out whether a particular changed by some user

    Hi gurus,             I am just trying to figure it out how to find out whether a particular user has changed a particular table or not. In other words table changes history. If any of you know about it please let me know. Thankyou Jason

  • Disk Utility, Verify Disk & Repair Disk unavailable

    Hi there! I want to check my Hard Disk with Disk Utility, but none of the two buttons (Verify Disk & Repair Disk) are available, I started up from my Mac OS X installation disc, and once, it told me that the disk had errors and needed to backup my fi

  • Signal Level Meter

    Signal Level Meter CATV Signal Level Meter GAO2002 is specially designed for CATV system maintenance. Signal Level Meter GAO2002 features small size (160mm x 130mm x 65mm) , light weight (368g including battery), long operating time (more than 6 hour

  • NEED HELP Xsan volume is not mounted (strange problem)

    I ask the help in solving the volume mount problem. (advance I am sorry for my english) All began with the fact that the MDC is rebooted and on the two LUNs were gone XSAN label. I relabeled these LUNs using commands: cvlabel -c >label_list then in t

  • Java download link required

    What is the link for JDK 1.5.15 download link ? I visited http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-javase5-419410.html Are these JDK download links or JDK update links ?