This discussion is archived
10 Replies Latest reply: Apr 2, 2013 9:07 AM by Andreas Weiden RSS

name of updated item

proora Newbie
Currently Being Moderated
Hello,
is there a way to get item name which have been updated?


regards,
  • 1. Re: name of updated item
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Hello,

    Give more details. Item that has been updated in database, or in the Forms module by the end-user ?

    Francois
  • 2. Re: name of updated item
    proora Newbie
    Currently Being Moderated
    in the forms ,
    when the end user does any update on the item, i want to get the item name to trace the change where have been done.
  • 3. Re: name of updated item
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    hum... another question: do you want to trace the very last change, so the one that will be stored in the database, or any changes until the commit instruction ?

    Francois
  • 4. Re: name of updated item
    proora Newbie
    Currently Being Moderated
    the idea behind that is , i want to get the form name and item name and the transction type (update/delete etc) into audit table , for tracing
  • 5. Re: name of updated item
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Yes but you don't really answer the question, so that I will guess that you want to trace the change in the database so that at commit time.
    Best is to code that in POST-INSERT, POST-UPDATE and POST-DELETE database. For update, compare the actual value with the database fetched original one via the Get_Item_Property( DATABASE_VALUE).

    Francois
  • 6. Re: name of updated item
    O.Developer Journeyer
    Currently Being Moderated
    Hi


    Hello,
    is there a way to get item name which have been updated?
    regards,

    ---

    Either your question is not correct, or you have to understand the oracle database concepts.

    Every entry in table can be stored, thru tirgger. On -Update/delete/insert
    Use these DB trigger and write to old and new values and user who did in a separate table.

    Hope u understand
  • 7. Re: name of updated item
    proora Newbie
    Currently Being Moderated
    Hi ,
    i am not talking about item value , i am talking about item name , i want to get only items name where the update happened on them.



    thanks
  • 8. Re: name of updated item
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Loop through the block's - Get_Block_property() - items, then see with previous value if the data has changed.

    Francois
  • 9. Re: name of updated item
    FrançoisDegrelle Oracle ACE
    Currently Being Moderated
    Something like this (not tested):
    DECLARE
      lc$blockDeb     varchar2(60); -- start block
      lc$block          varchar2(60); -- current block name
      lc$item               varchar2(60); -- current item
      lc$Type               varchar2(20); -- item type
      lc$itemdeb     varchar2(60); -- first item
    BEGIN
    
      LC$BlockDeb := get_form_property( NAME_IN('System.Current_Form'), FIRST_BLOCK ) ;
      LC$Block := 'the_block' ;
       
      lc$itemdeb := get_block_property(LC$BLOCK, FIRST_ITEM) ;
      lc$item := LC$BLOCK || '.' || lc$itemdeb ;
      while lc$itemdeb is not null loop -- For each item
    
        -- visible item ? --
        IF GET_ITEM_PROPERTY(LC$Item , VISIBLE) = 'TRUE' Then
              LC$Type := GET_ITEM_PROPERTY(LC$Item , ITEM_TYPE) ;
                   
              IF LC$Type != 'BUTTON' Then
    
                   -- value has changed ?
                   If Get_Item_Property( LC$Item, DATABASE_VALUE ) != Name_In( LC$Item ) Then
                        -- value has changed
                        -- store item name (LC$Item) in your table
                        null;
                   End if ;
                   
              End if ;
         End if;
                 
        lc$itemdeb := get_item_property(lc$item, NEXT_ITEM );
        lc$item := LC$BLOCK || '.' || lc$itemdeb ;
    
      end loop ;
      
    END;
    Francois
  • 10. Re: name of updated item
    Andreas Weiden Guru
    Currently Being Moderated
    Auditing in general is better implemented at the database level, as you will then audit all changes to your data, not only the changes which are done through forms.

Legend

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