Post-change trigger problem

I have problem with post-change trigger, i'm using Forms 10g
I have two block, one is database block and the other is non-database block for example A is Nondatabase block and B is Database block, I have written commit_form built-in in Key-Next-Item of a item in B(database) block. When it is getting executed commit_form built-in firing the post-change trigger of a item in A(Non-database) block. I dont know why it is firing and I dont want the post-change trigger to fire (we are not assigning any value to that item in A block during commit_form).
Can anybody help me on this..
Regards
Radha

when you issue a commit_form, forms will validate all items in all blocks which re not valid at that moment. This also occurs for non-database-block.
The question is why is the item not valid ? Are you putting something in it in some other trigger? If so, you could explicitly set the itemstate to valid with a
SET_ITEM_PROPERTY('BLOCK.ITEM', ITEM_IS_VALID, PROPETY_TRUE);btw.. you should not use the POST-CHANGE-trigger for validations etc. its better to use the WHEN-VALIDATE-ITEM-trigger.

Similar Messages

  • Post-change trigger alternative

    db and dev 10g rel2 ,
    hi all ,
    i want same functionality of using post-change trigger in 10g ?

    newbi_egy wrote:
    It would be easier to answer, if you would tell us what exactly is your problem. What does not work? What to you want to achieve?i've said before , how to get the same functionality of post-change trigger ?
    and i said that post-change trigger fires under these situations :
    the post-change trigger fires under these situations :
    1- The Validate the Item process determines that an item is marked as Changed and is not NULL.
    2- An operator returns a value into an item by making a selection from a list of values, and the item is not NULL.Above two points also done by When-Validate-Item trigger. so it's an alternative of Post-Change.
    3- Oracle Forms fetches a non-NULL value into an item. In this case, the When-Validate-Item trigger does not fire. If you want to circumvent this situation and effectively get rid of the Post-Change trigger, you must include a Post-Query trigger in addition to your When-Validate-Item trigger. See "Usage Notes" below.
    but when-validate-item trigger does not satisfy all these situations .Only point 3 are not satisfied by When-Validate-Item trigger. for this you need Post-Query trigger.
    It's just another clarification of Andreas answer.
    Hope it's clear now.
    Hamid

  • Post-change trigger raising when query!!

    this trigger is form related: i just attach a post-change trigger with an item.
    contains the following code
    declare
    name varchar2(50);
    name1 varchar2(50);
    begin
    name1 :='%'||:BLK_EMP_MST.FATHER_NM||'%';
    select first_nm INTO name from hrt_emp_mst
    where father_nm like name1;
    if(name is not null) then
    MESSAGE(name||' has same father name');
    MESSAGE('WARNING');
    end if;
    exception
    when no_data_found then
    null;
    end;
    it working fine when we insert a new record. but when i query for record, it fires, which should not be

    I agree with Manu, rather than use a Post-Change trigger to validate user input, use the When-Validate-Item (WVI) trigger instead. This will allow you to validate the input from a user, but the WVI trigger won't fire when a record is queried into your block.
    @Manu
    POST-QUERY is kept only for backward compatibility in 10gI think you meant to say "Post-Change" instead of "Post-Query." The Post-Change trigger has been depricated, but the Post-Query trigger is still valid in all Forms versions.
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • FRM-40735: illegal restricted procedure COMMIT in POST-CHANGE trigger

    I am using forms6i. I have three text fields FL1 ,*FL2* , FL3 in a form. Cursor passes from FL1 to FL2 and FL2 to FL3. I want when cursor transfers from FL1 to FL2 the form should be saved(commit). On FL1 i put COMMIT; in post-change.
    But when I pressed Enter key on FL1 it gives following error message.
    FRM-40735: illegal restricted procedure COMMIT in POST-CHANGE trigger
    Can you help me doing this.

    Gul wrote:
    I am using forms6i. I have three text fields FL1 ,*FL2* , FL3 in a form. Cursor passes from FL1 to FL2 and FL2 to FL3. I want when cursor transfers from FL1 to FL2 the form should be saved(commit). On FL1 i put COMMIT; in post-change.
    But when I pressed Enter key on FL1 it gives following error message.
    FRM-40735: illegal restricted procedure COMMIT in POST-CHANGE trigger
    Can you help me doing this.You cannot use COMMIT_FORM in post-change trigger. Because post-change only accept UN-restricted procedure. and commit is not.
    try this
    /* Trigger KEY-NEXT-ITEM on every item and write sample code */
    commit_form;
    next_item;Hope this works..
    Hamid
    Mark correct/helpful to help others to get right answer(s).*

  • Post Change trigger issue

    I placed a post change(Item level) trigger to LOV enable item(deptno) and insert the following code there.
    But as expected other block items (dname, loc) of dept block won't come to the form once change the LOV.
    ------------------ code --------------------
    BEGIN
         SET_BLOCK_PROPERTY('dept',DEFAULT_WHERE, 'deptno = ' || :dept.deptno);
         EXECUTE_QUERY;
    END;
    Any solutions
    thax
    Shabar

    shabar,
    the EXECUTE_QUERY cannot be given in POST-CHANGE Trigger.
    I think your requirement is this.
    some departments were already saved.
    if some one tries to create new department with old deptcode, then the actual department details should retrieve.
    if this is the case, then, give the code in the KEY-NEXT-ITEM Trigger.
    and if the deptno field is varchar, then u have to change the code like this,
    DECLARE
    CURSOR Cur_Dept IS SELECT DEPTNO FROM DEPT WHERE DEPTNO = :DEPT.DEPTNO;
    Str_Deptno VARCHAR2(20);
    BEGIN
    IF :DEPT.DEPTNO IS NOT NULL THEN
    OPEN Cur_Dept;
    FETCH Cur_Dept INTO Str_Deptno;
    IF Str_Deptno IS NOT NULL THEN
    SET_BLOCK_PROPERTY('DEPT', DEFAULT_WHERE, 'DEPTNO = ''' || :DEPT.DEPTNO || '''');
    CLEAR_BLOCK(NO_COMMIT);
    EXECUTE_QUERY;
    END IF;
    END IF;
    END;
    Its better to check whether the DEPTNO is valid or not.
    Regards,
    Manu.

  • POST-CHANGE TRIGGER

    Hi,
    I am using Forms Version 9.0.4.0.19.
    I created a form which consists of two blocks. Both blocks have a database field called city_code. I am trying to create a post-change trigger that would display the description and not the code of the city. Unfortunately, I keep getting no records found when I run the form although I now for certain there are records, there are records when I remove both triggers.
    Here is my code for the trigger for block1:
    =======================================================
    BEGIN
         SELECT DESCRIPTION
         INTO :INST.txtCITY
         FROM DICT
         WHERE CODE = :INST.CITY_CODE
    END;
    =======================================================
    Here is my code for the trigger for block2:
    =======================================================
    BEGIN
         SELECT DESCRIPTION
         INTO :CONTACT.txtCITY
         FROM DICT
         WHERE CODE = :CONTACT.CITY_CODE
    END;
    =======================================================
    Thanks in advance.
    VC

    Hi Again,
    I thought it worked, it didn't give me an error when I compiled it, but when I ran the form the data didn't appear. Below is my code, can somebody please help?
    DECLARE
         CURSOR LOOKUP_INST_TYPE IS SELECT DICT.DESCRIPTION
         FROM DICT
         WHERE DICT.CODE = :INSTITUTION.INST_TYPE
         AND DICT.TOPIC = 'INST_TYPE';
    BEGIN
         OPEN LOOKUP_INST_TYPE;
         FETCH LOOKUP_INST_TYPE INTO :INSTITUTION.TXTINST_TYPE;
         CLOSE LOOKUP_INST_TYPE;
    END;

  • JClient equivalent post-change trigger and JTextField issue.

    Hi,
    JClient 10.1.2
    What is the equivalent event listener I could use to obtain the forms post-change functionality?
    With following components:
    JTextField
    JComboBox
    JCheckBox
    For example on a JComboBox I would like to display a warning message dialog if a special value has been selected.
    I've tried using itemStateChanged method on a combo box but the message dialog is displayed everytime the row gains currency.
    Should I use focusGained to store the previous value and in the focusLosted method, check for a change?
    What would you recommend?
    One more question on JTextField, what is the method to track "global changes".
    I've tried using the DocumentListener, but the methods changedUpdate,insertUpdate and removedUpdate are fired on each keyboard action.
    Is there a way to track "global changes" on the whole text?
    Thanks
    Frederic

    You can work at setAttribute (Vo or Entity) level.
    You should be carefull, however, because in a cliente server environment it looks like the forms post-change event but in a 3 tier J2EE environment it's a server event and is not possible to interact with the screen in processing that event.
    Any other comment is wellcome.
    Bye
    Tullio

  • Post query trigger problem in master detail oracle forms

    Hello experts,
                        I am new in oracle forms n using Fission middleware 10g with oracle forms 11g at windows 7 platform.
    I have made a master detail form using a tab canvas.There is a database column STUDENTID and it is in my student tab with a TBL_STUDENTENTRY data block.Now I Have an another tab named previous_education with TBL_STUDENT_PREVIOU_EDU datablock here there is also a database column STUDENTID and corresponding field in my  previous_education TAB under TBL_STUDENT_PREVIOU_EDU  datablock.Now i want to add a display item to show  student name corresponding to STUDENTID.For this I have tried to make a select query in TBL_STUDENT_PREVIOU_EDU data block POPST_QUERY TRIGGER.
    begin
    select STUDENTNAME into :TBL_STUDENT_PREVIOU_EDU.STD_NM   from TBL_STUDENTENTRY where STUDENTID=:TBL_STUDENTENTRY.STUDENTID;
    end;
    But, This trigger is not fired at runtime,Please suggest me what is going wrong and give me the solution.
    Thank You
    AADITYA.

    http://www.club-oracle.com/forums/post_query-problem-in-oracle-forms-t9751/#post23794 ,  This is the link at where  I have tried to show my problem with the help of an image,Please get the link:
    thanx
    regards Aaditya.

  • Master-Detail Form - implementing some thing like Post-Query trigger

    Hi all,
    I am struggling to implement an eqivalent of a post-query trigger in Oracle Forms. Please bear with me as I am trying to explain in detail what the problem is.
    Here is my situation.
    I have three tables EMP, DEPT and LOCATION. I created a Master/Table pages on EMP and DEPT.
    Basic relationships.
    Each LOCATION has one or more DEPTs; Each DEPT is at one and only one LOCATION.
    Each DEPT has one ore more EMPs; Each EMP is assigned to only and only DEPT.
    Not getting too complicated, here are the table layouts:
    LOCATION:
    ID number(10,0) not null,
    NAME varchar2(20) not null
    DEPT
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    LOC_ID number (10,0) not null foreign key from LOCATION
    EMP
    ID number(10,0) not null,
    NAME varchar2(20) not null,
    DEPT_ID number (10,0) not null foreign key from DEPT
    Assume I have all the constraints, BIU triggers, sequences defined properly.
    I am using the APEX page wizard to create a Master/Detail Form on DEPT and EMP. The first page is the Master Report on DEPT. I want to display the Location Name on this page also. Because the Master Report allows
    you to change the query, I was able to add the Location Name as part of the
    query. This was very simple.
    Select a.name "Department_Name",
    b.name "Location"
    from dept a, location b
    where a.loc_id = b.id
    Moving on, In the Master Detail Form, I would like to get the Location Name as part of the first Region (Dept Region).
    In this region, I would like to include the Location Name also. So my first region on the Master Detail form includes:
    Dept Id: ________
    Dept Name: _______
    Location Name: __________
    As Region are automatically populated using using a Fetch Row from EMP table (Automated Row Fetch) on an After Header process point, I don't have a way of including the Location as part of query. So I created a Region level Item called Location Name, made it Display only.
    In the old SQL*Forms, or Oracle Forms days, I used to use a Post-Query trigger, or Post-Change trigger to fire on the Loc_Id column to populate the Location Name. Simple fetch like:
    Select name
    into :P80_location_name
    from location
    where loc_id = :P80_loc_id
    However, I am struggling to implement some thing simple like this in APEX. Tried creating a processes, computatations etc, but nothing is working.
    I have seen some previous responses to fetching values from a foreign table
    using a button or AJAX script, but this should be very basic. What am I
    missing here?
    Appreciate any insights.
    Thanks.
    John

    Hi John,
    I'm not too familiar with the post-query triggers in Oracle Forms, but the use of a List of Values (LOV) on your LOCATION table might do the trick for you. If you create a dynamic LOV based on your LOCATIONS table, it can then be referenced by the LOC_ID item on the Master-Detail page, to display the Location Name. You could try doing the following:
    1. Create a new dynamic LOV, LOCATIONS, using a query similar to the following:
    select Name d, ID r
    from LOCATION
    order by 1
    2. Edit the "Create" button on the Master report page, and in the "Optional URL Redirect" section set "Request" to CREATE. Click Apply Changes, to save the setting.
    3. Edit the LOC_ID item on your Master-Detail page, and set the following:
    * in the "Name" region change the "Display As" setting to Select List
    * in the "Label" region change the Label to Location Name.
    * in the "List of Values" region set the "Named LOV" to LOCATIONS
    * in the "Read Only" section, set the condition to Request != Expression 1, and set Expression 1 to CREATE.
    Click Apply Changes to save the settings.
    When you run the pages now, the Location Name field will appear as Read-Only when editing a selected Master row. The item will appear as a Select List when the user clicks "Create" on the Master page, to create a new Master row.
    I hope this helps.
    Regards,
    Hilary

  • Sir how I avoid I this error FRM-40735: POST-QUERY trigger raised unhandled

    Hi master
    Sir this error crate may problem for me
    FRM-40735: POST-QUERY trigger raised unhandled exception ORA-01403
    sir how I avoid I this error and show my message
    or system not show this error and bypass this error
    please send me code how I avoid this error
    thanks
    aamir

    There may be many causes of this error. You better diagnose and remove them.
    1- A field length may be less than what your query return a data into it.
    2- A POST-CHANGE trigger on any data may return un-desired data (character into numrice field, longer value than a field etc).
    likewise.
    Regards
    Sayeed
    [email protected]

  • What's wrong with "Post-Change" anyway?

    Post-change has been fading out since Forms 4.5 (maybe earlier). We are now supposed to use "WHEN-VALIDATE_ITEM" AND "POST-QUERY" to do the same job.
    Our company uses Post-change a lot to complete description fields (example: "Unit Description" for the "UNIT_CODE" field on "SALE". When the user enters a new UNIT_CODE OR a UNIT_CODE is returned from a query, we use POST-CHANGE on UNIT_CODE to populate the (non-base table) UNIT_DESCRIPTION field). We have hundreds of occurrences like this in our application.
    Now Oracle want to make us use two triggers when one is perfectly sufficient for the job but is now being phased out. This means we will need to either duplicate the code ("select unit_descr into :sale.unit_description from unit where unit_code = :sale.unit_code;") in two triggers or create a separate function and call it from both triggers. Neither of these options sounds good to us.
    Can anyone explain why post-change is being phased out? Will it ever actually go? (It's still there in Forms 9i)
    Cheers,
    Tim.

    Tim,
    From what I remember (it's been a while since I've done any Forms) the Post-Change trigger doesn't fire if the Item is set to NULL.
    This is fine when getting data back from the server; non-database items are populated correctly, and NULL values don't trigger any form of action.
    But, if during data input the user sets and item to NULL the Post-Change trigger does not fire, and so doesn't clear out you non-database item, or do whatever else you wanted.
    If you have the opportunity I would recommend changing the code to use When-Validate-Item and Post-Query. As you say, you don't want to duplicate code, so you'll need some common functions.
    An approach that I favour is to create one package per database block, with one procedure per item, into which you can pass an "Event Name". eg: for the EMP block...
    Post-Query:  begin
        emp_pkg.latest_hire_date('POST-QUERY');
      end;When-Validate-Item:  begin
        emp_pkg.latest_hire_date('WHEN-VALIDATE-ITEM');
      end;emp_pkg Package:  package body emp_pkg
      is
        procedure latest_hire_date
          ( p_event in varchar2 )
        is
        begin
          if (p_event = 'POST-QUERY')
          then
          elsif (p_event = 'WHEN-VALIDA[i][pre]Long postings are being truncated to ~1 kB at this time.

  • Cannot use GO_ITEM, GO_BLOCK in POST-CHANGE

    It is quite difficult to control the flow if I cannot use GO_ITEM, GO_BLOCK in POST-CHANGE trigger, is there alternative way?

    This really is an old chestnut. In the days of character mode many people used to put such code in key-triggers, which meant large numbers of triggers, possible loopholes, and a nightmare when it came to conversion to mouse navigation.
    After using various methods in the past, I have now standardised on using a FORM-LEVEL WHEN-NEW-ITEM-INSTANCE trigger in all of my new forms. Although I originally did this because I wanted to highlight the current field, I have since found it very useful for doing other things. If I want to navigate as a result of WHEN-VALIDATE-WHATEVER I set a variable to the name of the item I want to go to (could use a global but I prefer packaged variables). The W-N-I-I trigger reads the variable and does the GO-ITEM (and of course nullifies the variable).
    I also agree with Steve, POST-CHANGE is oldy-fashioned and not really the right thing to use.

  • Post-trigger problem in master detail form.

    I have designed a master detail form having two data blocks.
    in detail data block there is a post-query.
    when i tried delete one record in master block
    an error occurred ie
    'frm-40654. Record is updated by another user
    re-query to see changes'.
    in detail block there are 3 non database items.
    when i delete the post-query trigger the record is deleting properly.but the post-query trigger is also needed to display the non database item values. please give me a solution to tackle this problem.

    Hi,
    Even though yout items are non-database items, when you assign a value to them forms sets the block status to "CHANGED".
    Add the following lines add the end of your post-query trigger to reset the block status to "QUERY"
    set_record_property (GET_BLOCK_PROPERTY('YOUR_BLOCK_NAME',CURRENT_RECORD)
    ,name_in('system.cursor_block')
    ,STATUS
    ,QUERY_STATUS
    Hope this helps,
    Hugo

  • Post-query trigger ? save changes?

    I have a similar problem to that posted by 'nova' on Dec. 27, 2000. I have a form generated by Designer. The problem is that upon subsequent querying (F8 pressed twice), it asks me if I want to save my changes, when I have not made any changes.
    I looked in the generated code for the post-query trigger and found SET_RECORD_PROPERTY(:SYSTEM.TRIGGER_RECORD, 'NEW_CUST', STATUS, QUERY_STATUS) which is apparently not the problem, according to this prior post. I am at a loss and have tried everything I could think of.
    What else could be causing this? I checked to see if there were any items being set in the property sheet to default values, and removed the defaults - that did not work.
    ??? I would greatly appreciate any assistance. Thanks.

    Hi Pina,
    my similar problem I have solved like this:
    Post-Record trigger:
    BEGIN
    *** this is important to test the record status - without this I had the same problem
    IF :SYSTEM.Record_Status='INSERT' THEN
    IF :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV IS NULL THEN
    :TRANZIT_ZADAJ.ID_SADZBY_TV_PRENOSOV:=:SADZBY_ZADAJ.ID;
    END IF;
    END IF;
    END;
    You can check Pre-... and Post-... triggers
    if there are any items being set to any values.
    I hope this will help you.
    Helena

  • LEFT OUTER JOIN, Problem in POST-QUERY TRIGGER

    Hi,
    Please guide for the following
    I wrote below query in POST-QUERY Trigger of a TABULAR DATA BLOCK, having only one text item, called INVENTORY_ITEM
    select c.cat||' '||s.subcat||' '||l1.lvl1 ITEM INTO :DATABLOCK.INVENTORY_ITEM
    from itemcat c
    LEFT OUTER JOIN itemsubcat s on (c.catid = s.catid)
    LEFT OUTER JOIN lvl1 l1 on (s.subcatid = l1.subcatid)
    When I compile the module an error is generated
    *" Encountered the symbol 'LEFT' when expecting one of the following ,; for group having intersect minus order start union where connect ".*
    Above query is working fine in ORACLE SQL DEVELOPER .
    Any solution please.
    Regards,

    Difference

Maybe you are looking for