Updating a value of a text item in a multi record block based on a change

Hi,
I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue.

Hi,
I need to change the value of a text item in a multi record block based on a change to another item's value in the same block.
Suppose there's a text item in a multi record block called dt1 which is of type date, which is changed in a particular record. I want to change the values of the another item in the same multi record block, for all other records by running a loop through all the records in multi record block. I dont want to do it on the press of a button, it should do automatically on change. Help me resolve this issue.

Similar Messages

  • About populating a non-database item in a multi-records block

    Hi, all
    I have a problem about populating a non-database item in a
    multi-records block. This block is set to database block with a
    controlled item which needs to be populated after query. so I
    create a post-query trigger, but my problem is when the records
    listed in this block are less than 10 ( the record number is set
    to 10), the trigger fires no problem. but when the retrieved
    records are greater than 10, the error message is 'post query
    trigger raised unhandled exception ora 01403'. anyone can help me
    fix this problem?
    Thanks in advance
    Diana

    Diana,
    When you have an unbound item in a block and want to fetch
    some data into it you need to write a post-query trigger.What
    you have done is right.But it seems that u are getting a No data
    found error.I am sure about how u r populating data into that
    field.If u have written a select statement to fetch the data in
    post-query trigger, kindly handle an exception and find out the
    problem.Having a look at ur code(pos-query) would be much more
    helpful for giving a better solution.Try this a let me know.
    Thanks
    Vinod.

  • Editing record items in a multi-record block - 1 record at a time.

    Hello,
    I have the following scenario: Currently in my multi-record block, to edit an item of a record, the user has to double click on the record to enable the 'save changes' button. However, I want to turn the navigation to all other records turned off. The only way the user should be able to edit other records is save changes first, then again double click on the desired record to re-enable the 'save changes' button (at this time navigation to all other records should be turned off). ie., the user should be able to edit 1 record at a time (At any given time, I won't be having many records in the block which the user may have to modify).
    How can this be achieved?
    Thanks,
    Chiru

    That is pretty odd requirement, but this might work:
    When the user double-clicks the record, enable the Save button, and set a value in any column of the record to its current value. This will cause Forms to set the record status to CHANGED, and will not permit navigation away from the record until the When-validate-record trigger runs successfully.
    In the Save button, start a non-repeating timer to run maybe 20 milliseconds, then issue a Validate(Record_Scope); command. Check form_success then commit_form.
    In the when-validate-record trigger: Do any record validation that may be necessary, and Raise Form_Trigger_Failure if anything is wrong. Then check for the existence of your Save button's timer. If it does NOT exist, issue a message like: "You must Save the changes first" and Raise Form_Trigger_Failure; If the timer exists, do not raise the error.

  • How i can assign multiple values to tabuler text item (Help)

    HI
    IM PROGRAMMING ONE FORM AND I PUT THERE TABULER TEXT ITEM
    I WANT ASSIGN 63 VALUES TO THIS TEXT ITEM ONE BY ONE BY CODE I MEAN PUT FIRST VALUE IN THE FIRST TEXT ITEM ROW THEN SECOND TO THE SECOND TEXT ITEM AND LIKE THIS UNTIL I REACH TO THE LAST
    I MAKE LOV PUT I CAN ASSIGN ONE VALUE BY ONE VALUE EACH TIME DOUBLE CLICK ON THE TEXT ITEM ASSIGN ONE VALUE THEN DOUBLE CLICK ON THE SECOND ROW PUT MY BOSS WANT ASSIGN ALL VALUES 63 FROM ONE CLICK ON BUTTON

    Then you will have to create a when-validate-item trigger with a cursor based on your selection of your LOV . Loop through that cursor assigning the next in the next record by using the built-in function next_record. (put you selection for you value in a hidden item for example.
    something like this:
    Declare
    cursor c is
    select returnValueFromLOV
    from <yourtable>
    where yourdisplay value = :hidden_tem;
    begin
    for r in c loop
    next_record;
    item := r. returnValueFromLOV;
    end loop;
    exception
    when no_data_found
    your error handling;
    end;
    Hope it put you on the road to reach what you want
    Erwin

  • Spaces removed when inserting a value into a text item

    Dear members,
    (Forms 6i c/s)
    I have a databased function returning a string of characters (varchar2). This value can have spaces at its end.
    When I put this value into a text item in Forms, the spaces at the end are removed.
    How can I avoid that ?
    Thanks for your help.

    Hi,
    There is no elegant solution for this. Metalink has a discussion of the topic in note nr 247715.1
    /Michael

  • 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.

  • Duplicate item value in a Multi-Record Block

    Is there a way to chek duplicate value entered in multi record block?
    I have seen some solutions in this forum however nothing has worked for me till now. (using the formula, creating hidden items & creating group etc)
    Thanks in advance,

    To see if there are any other records in the block with the same value, use Kevin Clark's famous function to trap duplicates. You can find Kevin's function write up here:
    Re: checking for same rows in a tabular
    From Kevin's post:
    Create a field PK_COPY in a control block.
    Create program unit function COMPARE to compare two input params returning 1 if they match else 0.
    Create a field in the datablock PK_MATCH, calculation property formula, formula COMPARE(:DATA_PK, :PK_COPY)
    Create a field in the control block NO_OF_MATCHES, calculation property summary, summary type SUM, summarised
    item PK_MATCH.
    Also, your control block requires the Single Record property set to yes, and the base table block requires the Query All Records property set to yes.
    WHEN-VALIDATE-ITEM on DATA_PK
    :CONTROL.PK_COPY := :DATA_PK;
    if :NO_OF_MATCHES > 1 then
      message('You have already used that one');
      Raise form_trigger_failure;
    end if;

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • Get next value in a Multi Record Block

    Hi,
    I've a Multi Record block with 2 items like below.
    pos width
    1 7
    8 5
    13 5
    18 2
    ie pos in next item is sum of pos and width of previous item.I've already implemented this.
    The problem is if the user changes width in a particular record,I want to change next records pos automatically.
    To achieve this,I wrote a when-new-record -instance-trigger as follws:
    if :system.cursor_record=1 then
    :pos:=1;
    elsif :system.record_status='changed' then
    :pos:=:pos+:width;
    end if;
    but even Though I change column width of block,:system.record_status still remain 'INSERT'.
    Pls can u pls tell me how can I acheive this?
    Prashanth Deshmukh

    You cannot use Record Status like that.
    You need to create a procedure that loops through your entire block, keeping track of the pos and width of the prior record to calculate the new pos of each record.
    Your procedure would need to do something like this:
    Declare
        v_Pos  pls_integer := 1;
    Begin
      Go_block('B1');
      First_Record;
      Loop
        Exit when :System.record_status='NEW';
        :B1.pos := v_Pos;
        v_Pos := v_Pos + :B1.width;
        Exit when :System.last_record = 'TRUE';
        Next_Record;
      End Loop;
      First_Record;
    End;

  • 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

  • How to change the Height of item....!!!! in multi record block

    Here is the problem I want to change one item height in multiple records block..
    I tried to do the following
    set_item_instance_property(:system.mouse_item,:system.current_record,height,50);
    But this didn't work as the property for height couldn't be used with this built in..
    Can any one tell me any other suggestion to move around
    Thanks and best regares

    If you just have two sizes to display - e.g. normally the item is 1 line high but in the current item you want to show more information and want to make it say 2 lines high, then you can use a Mirror item to do this.
    Create another item in the block - set the Synchronize With Item property to the base item you want to "Resize".
    Set the Records Displayed property to 1 for this extra field.
    Put this field on a stacked canvas that is just big enough to hold it.
    The in your When-New-Record Instance trigger you can pop the stacked canvas up over the normal version of the field.
    That should do the trick.

  • No base table multi record block...updation

    hello all,
    i have a multi record block with two fields order & datetime to capture the time of the order. but this block is not based on any table. and i want to update another table with the datetime based on the order captured.
    how to do that...? there may be n number of records coming into the block at a time.
    thx in adv.
    Kris

    the best way is make it as a database block .and palace your insert statement in pre-insert trigger when you are inserting the record and place your update trigger in pre-update trigger u can also place your insert and update statement in back end, "i prefer the backend triggers").I think this is the best way because if you are using the go_block and next_record, that may take lots of time time to traverse record by record.
    regards
    mathew

  • Image item in multi-record block - PLEASE SOMEONE HELP !

    Hello everyone.
    I have a multi-record block with an image item that is not in teh table, is populated in the post-query trigger with a read_image_item, from a gif file. This block is child of another block. The problem is that the first records of the block, the ones that fit on the screen, are not showing the image properly, the image appears grey, distorted. In reality, the image dont adjust to the size of the item, as it is especified in the properties. When i scroll down, the rest of records show the image perfect, but this ones still are distorted.
    Forms is 6.0.8.22.1, over oracle 9i. Thank you all in advance.

    hello
    just me what is datatype of ur image record ?

  • Image item in multi-record block

    Hello everyone.
    I have a multi-record block with an image item that is not in teh table, is populated in the post-query trigger with a read_image_item, from a gif file. This block is child of another block. The problem is that the first records of the block, the ones that fit on the screen, are not showing the image properly, the image appears grey, distorted. When i scroll down, the rest of records show the image perfect, but this ones still are distorted.
    Forms is 6.0.8.22.1, over oracle 9i. Thank you all in advance.

    hello
    just me what is datatype of ur image record ?

  • Validation item in a multi-record

    Hi!
    I have a multi-record block and I want to avoid duplicated items from the user on it (these record aren´t saved yet, I want to validate them before commit).
    Anyone knows how I can validate them ? I made a procedure but it only works in trigger Key-Next-Item from the block.
    Thanks
    Veronica

    Re: duplicate records in  a multi record block

Maybe you are looking for