Post Text Item Trigger

I have a master block and a detail block, which is a multi
record block; for one item in the detail block I created a post-
text-item trigger to check if this value exists;
the problem now is that this trigger not only fires if I leave
the item, it also fires at the beginning when the canvas is
dieplayed and I execute a query
can anybody tell me why this happens and how to avoid it?
thx in advance, michaela
null

Michaela (guest) wrote:
: I have a master block and a detail block, which is a multi
: record block; for one item in the detail block I created a
post-
: text-item trigger to check if this value exists;
: the problem now is that this trigger not only fires if I leave
: the item, it also fires at the beginning when the canvas is
: dieplayed and I execute a query
: can anybody tell me why this happens and how to avoid it?
: thx in advance, michaela
What happens in your form is perfectly normal.
You should use the When-Validate-Item trigger, and, eventually,
set the text-item required.
null

Similar Messages

  • Validation in POST-TEXT item trigger

    Hi
    Does POST-TEXT -ITEM trigger fire in ENTER-QUERY mode?
    If not suggest me solution for following scenario:
    I have supplier field in master block. When Form is in -ENER-QUERY mode, i want to validate the user input in the supplier field before user navigate out of the field using TAB KEY (KEY-NEXT-ITEM) or MOUSE (POST-TEXT-ITEM).
    Thanks
    Cheers
    Ram

    The Forms help says that it doesn't, and nor does when-validate-item.
    It looks like you'll have to use the when-new-item-instance trigger. You can store the value of the current field and whenever the trigger fires, run some code to validate that field. If it passes the validation then store the value of the new field, otherwise put the user back in the original field.
    You'll also need to call the code from the key-exeqry trigger, so that you can validate the field which the user is in when they execute the query.

  • FRM-40737: illegal restricted procedure COMMIT in POST-TEXT-ITEM trigger

    Hi All,
    I tried to execute an insert statement in a POST-TEXT-ITEM trigger and use commit to save data in the db but this error appeared:
    FRM-40737: illegal restricted procedure COMMIT in POST-TEXT-ITEM trigger
    How to solve it? OR how to save every text item value entered in the database?

    I don't fully understand, why you need to insert records on post-text-item, but the possible solution is:
    Write a DB procedure which does insert and commits it.
    Call this procedure in post-text-item.
    Problems will occur if your procedure is modifying the table columns, which are used in form. Form will notice that values in DB have changed and you will have "Record has been changed by another user. Please requery to see changes" error. But if records, affected by DB procedures, are not used in form, the wverything will be OK.

  • Diffrence between when-validate-item and post-text-item trigger

    What is the Diffrence between when-validate-item and post-text-item trigger, when they are written for the same item and the basic diffrence between when-validate-item and post-text-item trigger.

    Two big differences:
    1. post-text-item is only available to, and only triggered when leaving a text item, whereas when-validate-item is triggered by the forms validation process, and is available for any item type.
    2. p-t-i is a navigation trigger and you cannot invoke it programmatically, whereas the 'validate' built-in can be used to execute validation which fires the w-v-i trigger(s).

  • Execute query when post text item

    Anybody can help ?
    I create 2 block, first a data block and another is a control block with field customer_search field,
    after inputing customer id in search field on control block,
    I want to execute query.
    my code :
    set_block_property('customer',default_where,'custid=:control.customer_search');
    execute_query;
    error : frm-407 : illegal restricted procedure execute_query in post-text-item trigger.
    How to solve this problem ?
    notes: If I create one push button and put execute_query in there, every thing is fine.
    but the my user does not like that.
    Thank.

    hi,
    first of all change ur statement as
    set_block_property('customer',default_where,'custid='||:control.customer_search);
    means u must use pipe sign while using bind variable
    secondly
    u should use key next item trigger
    go_block(user desired item or block);
    --and then use this satemant
    clear_block(no_validate);
    execute_query(no_validate);
    i hope it wil slove ur peoblem if it will NOT then please acknowledge otherwise we will go for a other solution
    thanks
    imran
    manager IT
    www.masoodtextile.com

  • Go-item in post-text-item oracle forms 6i

    It is not possible to use go_item in post-text-item trigger in forms 6i
    How to overcome this?

    I've never tried to force the user to do that.
    But Kevin's second solution would do it:
    Set a packaged variable and put the code in a form-level WHEN-NEW-ITEM-INSTANCECreate a package specification in the form -- I always name such a package P0.
    In the package, create a variable:  Next_Itm  varchar2(60);In your post-text-item trigger, set the package value:    P0.Next_Itm := 'BLOCK_B2.ITEM_6';In the form-level when-new-item-instance trigger:
      If P0.Next_Itm is not null then
        Go_Item(P0.Next_Itm);
        P0.Next_Itm := null;
      End if;

  • Display Hint Text in Oracle Forms 6i at Text Item

    Dear all seniors
    I want to show Hint text at Text Item in Oracle Forms 6i.
    when my cursor Focus goes at that item. I mean when I go with Tab key or Enter button then it show display text.
    even though my mouse is not on that item.
    please how it would be possible
    thanks.
    G.Y

    Please create a display_item(for eg. Disp_Mess) just below the text field (For eg:-MyField) where you want to show hint. And then assighn Hint text to "DISP_MESS" in NEW-FORM-INSTANCE or at Initial value. Then create a PRE-TEXT-ITEM and POST-TEXT-ITEM trigger for MyField.
    -- PRE-TEXT-ITEM trigger write following code.
    SET_ITEM_PROPERTY('DISP_MESS',VISIBLE,PROPERTY_TRUE);
    --POST-TEXT-ITEM write following code.
    SET_ITEM_PROPERTY('DISP_MESS',VISIBLE,PROPERTY_FALSE);
    It will work for you.
    Regards
    Ahamed Rafeeque Cherkala

  • How can i back to Text Item ???

    i have TextItem
    . in Post_Item Trigger i am Checking the value in Text Item
    With Value in DataBase and Get Other Data Related by this value into another Text Item.
    if value not Found in dataBase how can i came back to Text_item to change the value .
    like text item contain code and return Name into another TextItem
    if code not found do not leave TextItem.

    First of all, do NOT do validation like that in a post-text-item trigger. You are needlessly running validation every time the user tabs through the field.
    You should be putting validation ONLY in a when-validate-item or when-validate-record trigger. They only run if the value has been changed.
    And any time you issue an error message, it must always be followed by RAISE FORM_TRIGGER_FAILURE;

  • Navigating to the text item with color

    hi all,
    i have 10 text_items in my form, i want that when i am in first text_item the color should change default to any color i want (take suppose yellow)
    then when i am going to second text_item then color should change to yellow like that it has to happen for all the text_items.
    how can i do this... where i should write the code and what code...
    please reply...

    Create one VISUAL ATTRIBUTE with background color = yellow and use the code as below on block level triggers.
    1. Create one trigger on block-level called PRE-TEXT-ITEM and use the code as below...
    SET_ITEM_PROPERTY(:SYSTEM.CURRENT_ITEM,VISUAL_ATTRIBUTE,'VISUAL_ATTRIBUTE_NAME');2. Create another trigger on block-level called POST-TEXT-ITEM and use the code as below...
    SET_ITEM_PROPERTY(:SYSTEM.CURRENT_ITEM,VISUAL_ATTRIBUTE,'DEFAULT');-Ammad

  • How do you write UNDO for a text item?? examples? or a REDO??

    How do you write UNDO for a text item?? examples? or a REDO??
    I created a pop-up menu with CUT, COPY, PASTE, UNDO, CLEAR for my text items.
    Using MAGIC menu type works great but there is no MAGIC for UNDO or REDO.....
    How do you write UNDO for a text item?? examples? or a REDO??
    I have Oracle Forms 6i...
    Lets say I highlight all the text in the text item, and start typing over it... then I realize OH NO it is the wrong text field...
    Now I want to UNDO the typing and get back to the previous text.
    I'd use the initial value that was populate right? How do I access that if that is correct?
    Thanks, Bill

    You can use;
    <ITEM> := Get_Item_Property(<ITEM>,DATABASE_VALUE);
    Or you will have to write a pre-text-item trigger;
    PRE-TEXT-ITEM:
    :CTRL.CURRENT_VAL := :<BLOCK>.<ITEM>
    MENU (PL/SQL):
    :<BLOCK>.<ITEM> := :CTRL.CURRENT_VAL;
    You may also want to set the item property back to ITEM_IS_VALID so that item validation does not fire again.

  • Creating Dynamic Text Item

    Hi
    I am creating an application which needs dynamic creation of text item.
    ie., after POST-TEXT-ITEM I want to creat another text box beneath the existing text item.
    Is there any possibilities that we can create the text item by Code.
    Thanks in advance
    Vijendra

    Hi ,
    Take a look at the following:
    Building a dynamic block at run-time
    Regards,
    Simon

  • What is the Pre Trigger for combo item same like Pre-Text-Item.

    Hi Everyone,
    Can anyone help what is the same trigger like Pre-Text-Trigger for combo items.
    Thanks in advance.

    Thanks for your reply Mr. Ammad,
    --vDatabaseValue:=GET_ITEM_PROPERTY('item_name',DATABASE_VALUE);
    This will fetch the value from the database. But what I need is to store the value of the item itself.
    For example:-
    I created one combo box called Item_Code and one text item called Quantity in my form.
    I am choosing the item code from the combo box lets say 'ABC123' then my cursor moved to Quantity.
    Now I am again coming back to the Item_Code to change the value which already I choosed 'ABC123', here I need to store that value 'ABC123' into an global variable before to change.
    Hope you understand.
    Thanks.

  • How to call another form ,if option is entered in a text item object ???

    hi ,
    I am created an application ,where in i press a button which call another form having a menu .
    I select any one of the option from the menu ....i enter a number in the text item object of this form ....depending upon what option i have typed .....i would like to call another form ...
    My questions are
    1) Which trigger of this text item should be enabled,and what code to i write in this trigger ?
    2) Since this form is not having any database insert,delete ,update or query (select)
    it should directly go to the new form,whose option i provide in the text item .
    Sunny

    hey bro, i am assuming that ur text item contains the form name, any relevant trigger can be used for user action, like key-enter, post-change or key-next-item.
    to run a form u can use functions call_form or open_form with proper paramters.
    if u want to forward the entered text in the item, use global variable for the session.
    it doesnt matter if the form contains database items or blocks, all u have to do is run the form.
    e.g,
    declare
    VAR VARCHAR2-------;
    begin
    /* u can use the variable to concatinate or modify too, also can use global variable
    var:=:urblock.uritem;
    /* use ur own relevant parameters */
    open_form(VAR,ACTIVATE,NO_SESSION);
    exception
    when---------
    end;

  • Text item validation into Formular.

    hi.
    From some days I have written my fiirst application using Oracle Forms6i.
    In oracle9i I created table USER with column id_user number(5), username varchar2(10) and passwd varchar2(12).
    In oracle forms builder I created the formular with 4 controls(2 fields - username and passwd ,one button to login user and Text item to the botton of this formular to print message for user). In ProperPalette for Text item 'username' and 'passwd' I set adequately Maximum Lenght peperty to 10 and 12(for 'passwd' field) and Required to Yes.
    Then I wanted to make a validation username and passwd fields in this way, that the user can put in 'username' field the string with length between 8 to 10 and for 'passwd' between 8 to 12 and checking all other cases incorrect data entering by login user.
    I created trigger WHEN-MOUSE-CLICK for button with this body:
    declare
         dlug_username number;
         dlug_passwd number;
    begin
         dlug_username := length(:user_data_log.username);
         dlug_passwd := length(:user_data_log.passwd);
         if (:user_data_log.username = NULL and :user_data_log.passwd = NULL) then
              :user_data_log.komunikaty_logowania := 'you didn enter any data!';
         elsif dlug_username >= 8 and dlug_passwd >= 8 then
         :user_data_log.komunikaty_logowania := 'Correct data!';
         elsif dlug_username < 8 or dlug_passwd < 8 then
                   :user_data_log.komunikaty_logowania := 'Fields USERNAME i PASSWD must have more then 8 sign. Correct them!';
                   :user_data_log.username := '';
                   :user_data_log.passwd := '';
         end if;
    exception
         when VALUE_ERROR then
         :user_data_log.komunikaty_logowania := dlug_username;
    end;
    When I run this form by Run Form client/server button, it's not matter what I'll enter in two field 'username', 'passwd', when I press button always is invoke exception section
    but no if condition.
    Now, I don't know what do with this. What is the best way to resolve problems with validation of form elements?
    Thanks in advance for all help, some hints, tutorials. I appologise for so long post, but I
    want directly describe my problem. Thanks.

    Hi,
    Regarding to your post and your problem , obviously the code doesn't go into the
    IF condition and validate it becouse the syntax is not appropriate and every time it goes to the IF it jumps into the exception part. Thats why you have to correct your code as fllowing.
    if (:user_data_log.username IS NULL) and (:user_data_log.passwd IS NULL) then
    etc till the end of the code.
    Kindly if this approach meet your requirment of solving , update your problem with a Subject of Solved
    Regards
    Omar

  • Change the color of text item after execute query

    Dear friends
    I would like to know how can I make a tabular form like grid and chang the color of text item when (for exp in emp table) the value of sal column between 2000$ and 4000$.
    I used the SE_IEM_PROPERTY command but it change all of the text items of sal column.
    please help me
    thanks a lot

    Highlight the Existing Record in Forms
    (Compatible with 4.x, 5.x, 6.x & 9i)
    Step 1: Create a New Visual Attribute(BLUE_VA) (Color of highlighted record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
              Foreground Color – Black
              Background Color – Blue
              Fill Pattern – Transparent
    Step 2: Create another Visual Attribute (WHITE_VA) (Default Color of the record)
              Font – Arial
              Size – 8
              Style – Plain
              Font width - Normal
              Font Weight - Bold
    Foreground Color – Black
              Background Color – White
              Fill Pattern – Transparent
    Step 3: Add Following code to Block-level Trigger WHEN-NEW-RECORD- INSTANCE, POST-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'BLUE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'BLUE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    Step 4: Add Following code to Block-level Trigger PRE-RECORD, PRE-BLOCK
    (Add to the block, which has these records)
    -- Following code will only highlight an item
    DISPLAY_ITEM(<block_name>.<item_name>,'WHITE_VA');
    -- Following code will highlight complete Record (ref: DISPLAY_ITEM example)
    DECLARE
              cur_itm VARCHAR2(80);
              cur_block VARCHAR2(80) := :System.Cursor_Block;
    BEGIN
    cur_itm := Get_Block_Property( cur_block, FIRST_ITEM );
    WHILE ( cur_itm IS NOT NULL ) LOOP
    cur_itm := cur_block||'.'||cur_itm;
    Display_Item( cur_itm, 'WHITE_VA');
    cur_itm := Get_Item_Property( cur_itm, NEXTITEM );
    END LOOP;
    END;
    I am using the above code in one of my forms and I so far haven't seen any problem

Maybe you are looking for

  • Imported JPEG images are too light

    Imported JPEG images appear lighter/brighter than the scanned image. How can I make JPEG images appear with the correct lightness/brightness so they look like the actual book or magazine from which they were scanned? Using Apple's "Preview" to look a

  • How to get 100% view centered when opening document?

    I work with my documents at 100%. Whenever I open a document the pages are placed rather randomly on my screen... Is there a way to have the pages centered by default? I have to press cmd-alt-0 (to center the spread) and then cmd-1 (to g to 100%) eve

  • Password problem with updating Macbook to OS 10.4.7

    I updated to OS 10.4.7 from 10.4.6, and after restarting I can't log into my account, for some reason the password has changed? So I restarted my macbook again, using the Install Disc 1. If I try using the Reset Password Utility on my Macintosh HD, i

  • Rename node in process chain

    In the process chain in left side screen I need to change Node name descript. "Not Assigned" to "New Name". Please advice how to do that ?. Thanks Liza

  • Screensaver blips...

    I've been having a problem with my screensaver. I had it set to Shell for a while, then I noticed that it was showing the Computer Name screensaver. I changed it then to Flurry... same thing. Changed it again to iTunes Artwork, and that one stayed. L