Updating a datablock

Hi
I created a datablock using the datablock wizard. It displays all the records from a table. Now I would like to display only a particular set of records from the table so would like to introduce a where clause. I am not sure how I can use a where clause for an existing datablock. Please help me

Hello,
Click on the block.Press F4 to open Property Palette, under Database section, there is the Where Clause.Set it according to your needs.
Example:
salary >1000 and deptno=10
More on where clause can be found in Forms Builder online help.
Kind regards,
Alex
If someone's answer is helpful or correct please mark it accordingly.

Similar Messages

  • Error updating a datablock that uses a view

    I have a view that is using a UNION ALL between two tables. I have written the instead of trigger properly and I have no problem updating, inserting or deleting thru the view in Oracle.
    The problem is that forms will query the view fine, but will not allow me to update any field associated with the datablock. I'm getting the following error message:
    "FRM-40501: ORACLE error: unable to reserve record for update or delete"
    and when I do display error, I get the following message:
    "ORA-02014: cannot select FOR UPDATE from view with DISTINCT, GROUP BY, etc."
    Any help would be appreciated, thanks in advance!

    Well I only did the instead of trigger thing once.. But Ill stick my neck out anyway...
    Since you have instead of triggers you may be able to get away with just putting a "null;" in the on-lock trigger or write your own locking code in the on-lock trigger. Search for locking in this forum for examples.
    I think using the instead of triggers may override the need to specifically put insert, update, and delete statements in on-update, on-delete, on-insert form triggers.
    Basically with instead of triggers the form will try to do its normal processing and issue select, insert, update, and delete statements on the view, which usually causes headaches, but the instead of triggers on the view will take over do the DML upon other appropriate tables making everybody happy. I think the locking is your issue.
    Now if you werent using instead of triggers you would have to put update, insert, delete statements in the on-insert, on-update, on-delete triggers.
    I think.. :)

  • Commited Changes!

    Hello All,
    When we Commit, LGWR writes out the data(Vectors Changes) to the redo logfile and DBWR does nothing.
    Say i've done millions of rows of updation and committed but actual datafile block is still not updated(delayed block clean out) and in the mean time one user queries the not updated data block then oracle will send it to the Undo block to look at the previous value.
    How does oracle clears old value of undo to look at the new value from redo logfile?
    Regards!

    so where does user query get new values? in redo log? or buffer cache(how)? Let me take a chance to answer it.
    Answer is redo log.
    howCommitted data is written into the log files.Oracle makes sure that once committed the data is there in the redo log files which means from there it can recover at any point of time.
    Redo log: The redo log is guaranteed to contain all committed data, including changes to UNDO segments. This is used as part of the database integrity. During normal database operation, the redo log is strictly write. Oracle never reads from redo during normal operation. This is for performance reasons.
    Commit will be written to the redo log. So, a "commit marker" goes to redo, and is written to disk. This will mark the transaction committed in the undo segment header. Beyond that, nothing else has to happen immediately. Oracle is very good at deferring work till later. So, the blocks in the datafile still show as uncommitted, and point to the (now committed) transaction that's indicated in the undo segment header. The next time that block is read from disk, Oracle will do _"delayed block cleanout"_ and clean out those left over pointers. It will read the block header, see the pointers to the the transaction, go read the undo block header, find the transaction is committed, and update the datablock accordingly.
    Source: Aman and Mark in different thread links.
    Regards
    Girish Sharma

  • Relationship between datablocks

    Gurus,
    I've been working with OAF for the past few years. I'm currently attempting some changes to a custom ERP form developed by a guy who has left the company.
    The objective was to add several columns to the canvas and related datablock. I've already altered the underlying table to include the new columns being referenced. I'm able to compile the new form on the server and data is writing properly to to underlying table.
    My issue is that for each of the new values for the new columns, there are also 15 optional values which can be written to another table. These other values have been defined within a seperate datablock and appear on the right side of the canvas. However, when I tab through the newly define fields, the values aren't being written properly to the columns of this second table. Only the value of the last newly defined column is able to be written.
    Any idea of where I should look to resolve this inconsistency?
    I've updated the Program units to accomodate the new columns for the "main" datablock.

    There are 3 relationship properties for master detail relationship
    1. Casecading : In this property If Master block record is deleted then child record will be delete automatically with master.
    2. Isolated: I will allow to delete to parent block records while child records exit in the block.
    3. Non-Isolated: If child exist then master record can not be deleted.
    Exapmple:
    Master Block:
    Master Record 1
    Child Block:
    Child Record 1.
    Child Record 2.
    1. If Master Record 1 is deleted then child record 1 and 2 will be deleted with this record automatically.
    2. While Child Record 1 and 2 exist property will allow to delete master Record.
    3. It will not allow to delete Master record 1 if child record 1 or 2 exist.

  • Setting query datasource at runtime for FORM Datablock

    Hello all,
    we have below requirement -
    the Form datablock is build on a customized table. we need to populate some of the fields of the form by writing a view which joins tables across variousl modules. the form data will be queried by giving po number in query find window. then the rest of the fields are entered from the form front end and saved to the DB Table. we want to query the new po numbers from the view from the query find window. where as the existing po numbers will be queried from the form datablock table only... for this i wrote the below pre_query trigger at datablock level.
    declare
         po_num number;
    BEGIN
    :parameter.G_query_find := 'TRUE' ;
    select count(*) into po_num from ICS_PO_IBOT_ICOT_REP where vendor_po_num = nvl(:QUERY_FIND.PO_NUMBER, vendor_po_num);
         if po_num > 0 then
    COPY(:QUERY_FIND.PO_NUMBER, 'ICS_PO_IBOT_ICOT_REP.VENDOR_PO_NUM');
         else
    set_block_property ('ICS_PO_IBOT_ICOT_REP', QUERY_DATA_SOURCE_NAME, '(select * from ICS_PO_IBOT_ICOT_REP_VIEW where
    VENDOR_PO_NUM = :QUERY_FIND.PO_NUMBER)');
    end if;
    :parameter.G_query_find := 'FALSE';
    end;
    here ICS_PO_IBOT_ICOT_REP - DB TABLE
    ICS_PO_IBOT_ICOT_REP_VIEW - view
    condition is checking for existing pos in table.....
    The above form while running from oracle apps, entering a New po number in query find window gives following error -
    ORA-01008: not all variables are bound.
    whereas for old pos it works correctly......................Please help on this...
    on more analysis from help-diagnostic-system - last query it gives the below code
    SELECT LAST_UPDATE_DATE,LAST_UPDATED_BY,LAST_UPDATE_LOGIN,CREATION_DATE,CREATED_BY,ATTRIBUTE1,ATTRIBUTE2,ATTRIBUTE3,ATTRIBUTE4,ATTRIBUTE5,ATTRIBUTE6,ATTRIBUTE7,ATTRIBUTE8,ATTRIBUTE9,ATTRIBUTE10,ATTRIBUTE11,ATTRIBUTE12,ATTRIBUTE13,ATTRIBUTE14,ATTRIBUTE15,ATTRIBUTE16,ATTRIBUTE17,ATTRIBUTE18,ATTRIBUTE19,ATTRIBUTE20,ATTRIBUTE21,ATTRIBUTE22,ATTRIBUTE23,ATTRIBUTE24,ATTRIBUTE25,ATTRIBUTE26,ATTRIBUTE27,ATTRIBUTE28,ATTRIBUTE29,ATTRIBUTE30,ORG_ID,CONSULTANT_ID,CONSULTANT_NAME,VENDOR_NAME,VENDOR_CONTACT_NUM,VENDOR_EMAIL,VENDOR_DIVERSITY_STATUS,CONSULTANT_INFO,MINORITY_STATUS,REMARK,CBC_DATE,ACKN_DATE,IBM_PO,PO_STATUS,SOW_NUMBER,PO_TYPE,START_DATE_ON_PO,IBM_PO_ISSUE_DT,IBM_PO_ICS_RCV_DT,IBM_PO_CHANGE_DT,SKILL_LEVEL,REQUESTER,REQ_CONT_NO,REQ_EMAIL_ID,BUYER,BUYER_CONT_NO,BUYER_EMAIL_ID,TRANS_STATUS,ST_BILL_RATE,ST_HOURS,OT_BILL_RATE,OT_HOURS,EXPENSES,TOTAL,REGION,AREA,LOCATION,STATE,JOB_ROLE,JOB_SKILL,LOB,CSA_REQ_NO,CSA_SUBMIT_DT,CLIENT,WAGES,EXEMPT,BENEFIT_STATUS,US_NATIONAL,VISA_STATUS,MATRIX_PRICE,SCORP_C2C_W2H,REFERAL_STATUS,REBATE_STATUS,REBATE_PERCENTAGE,REBATE_DESC,CSA_FEE_STATUS,CSA_PERCENTAGE,ICS_FEE,MARK_UP,ADD_INFO,VENDOR_PO_NUM,CCF_CREATED_DATE,CCF_MODIFIED_DATE,DOJ,DOT,DATE_OF_MODIFICATION_DOT,ST_PAY_RATE,ST_BURDEN_RATE,OT_PAY_RATE,OT_BURDEN_RATE,RATE_DESC,SALES_PERSON,RECRUITER,PROJECT,ACCRUAL_REVERSAL,WEEK_1,WEEK_2,WEEK_3,WEEK_4,WEEK_5,ESTIMATE,ACCRUALS,TOTAL_HOURS,BILLABLE_AMOUNT,TOTAL_COST,GM_AMOUNT,GM_PERCENTAGE,INVOICE_NUMBER,INVOICE_AMOUNT,SUBMITTED_ON,RENEWAL_PO,REJECTED_ON,RESUBMITTED_ON FROM (select * from ICS_PO_IBOT_ICOT_REP_VIEW where
    VENDOR_PO_NUM = :QUERY_FIND.PO_NUMBER)
    please suggest what am i missing?????????????????????
    Thanks,
    Sam

    here are the answers to your questions-
    How do you update record?
    Do you have any ON-UPDATE, POST-UPDATE, PRE-UPDATE triggers on this block?
    Do you have any database triggers on the table?
    What is DML Data Target Type property of this block?
    it was not required for me to write any ON-UPDATE, POST-UPDATE, PRE-UPDATE triggers on this block to update record. these are done or taken care off automatically. no database trigger is associated with the table. DML data target type is table.
    also the block has Query data source type as Table only. and the query data source name is the db table ie ICS_PO_IBOT_ICOT_REP. so what u suggest now? if i simply click on new button and enter some data onto form and save it it is inserting record onto db table. so why cant it insert the record in current scenario when a new PO is queried from the view. Please help on this where i am missing.................

  • Slow updations (Oracle 11g 64 bit enterprise edition on Linux RHEL)

    I have created Following table for profiling updates per second in Oracle Database
    Test(RecordId number,Desciption varchar2(2000) //Btree Index on record id only
    Table has 10000 records only.
    I did updation for every record in loop by follwing query(Stored procedure executed on same server where database exists no network is coming in picture)
    update Test set description = description + 'something' where Recordid = i (loop counter)//existing description has 1000 characters
    I am wondering that updation of only 10000 records was taking 100 Seconds.
    I was expecting atlease 1000 records/second but it is 100 record/second
    Can anyone help to correct me and tell how can we improve database updations?
    Processor Dual proc dual core
    Raid with reading speed 2.5Gbps
    OS : Linux RHEL
    Database:Oracle enterprise edition 64 bit.
    sga_max_size = 1.5 GB
    Any help will be highly appreciated.

    You are running a loop but Oracle will give you read consistency.
    Oracle is probably cloning some of the datablocks as it re-reads them because
    it finds that the block has been previously updated.
    That sort of a loop is absolutely the wrong way to test Oracle.

  • Unable to update record in web Form

    Hi, i am unable to update record in a form. I am building a custom form using forms 6i and putting it on the web in oracle applications 11.5.9
    I used template.fmb as a starting point for my form. I have one datablock based on a table. Insert, update and delete properties are set to yes on the property pallete of data block. The table against which i am running the form has a primary key which is a combination of two fields. I am able to update a record with pure SQL running against the table.
    My form now brings back a record from the db like it should but whenever I try to update that record either by pressing Action Save or by clicking button that has update statement in it, instead of doing an update, it does an insert and tells me that this record already exists and that i entered value(s) that must be unique for each record. It thinks I want to insert but I want to update. What am i doing wrong???
    Update allowed value is set to Yes in all the items in the data block and at the data block level as well. Querly_only is set to no.
    What's even more frustratinng is that I've ran the form manually before starting with template.fmb and have been able to update the table but when I put it on the web and used template.fmb it stopped working!
    I am very new to forms, can anybody suggest anything? Please help!!!

    When you populate the 2nd block with a select into query, it's the same as just typing the data into the block. The record is treated as one needing to be inserted, not as one that is queried.
    To populate it using a true query, but with data from the LOV, you can do this:
    Programmatically set the default_where clause of the block based on the LOV. For example, if a name is chosen from the LOV in an item called LOV1, you could do:
    set_block_property('block2','default_where','name='''||:block1.lov1||'''');
    or if the LOV is a number, like a department number:
    set_block_property('block2','default_where','deptno='||:block1.lov1);
    The tricky part when you build your where clause is that you must surround strings with single quotes, and the way to do this is to use two single quotes to represent an actual single quote in the where clause. Otherwise a single quote is interpreted as part of the PL/SQL syntax.
    Then, just navigate to block 2 and execute a query:
    go_block('block2');
    do_key('execute_query');
    I hope this works for you. I didn't have time to test this, so I hope I didn't make any syntax errors when typing.

  • To connect a datablock to a query - stored procedure: problem

    I have the following table...
    CREATE TABLE I_TIPOLOGIA (
    CODICE NUMBER(6),
    DESCRIZIONE VARCHAR2(100),
    CONSTRAINT I_TIPOLOGIA_PK PRIMARY KEY (CODICE) );
    and the following package to connect a datablock to
    previous table with a stored procedure...
    CREATE or REPLACE PACKAGE DATABANKER_TIPOLOGIE AS
    TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    PROCEDURE leggi(resultset IN OUT TipTableOfRec);
    END DATABANKER_TIPOLOGIE;
    CREATE or REPLACE PACKAGE BODY DATABANKER_TIPOLOGIE AS
    PROCEDURE leggi(resultset IN OUT TipTableOfRec) AS
    BEGIN
    SELECT * BULK COLLECT INTO resultset
    FROM I_TIPOLOGIA;
    END leggi;
    END DATABANKER_TIPOLOGIE;
    When I compile the form I receive in QUERY-PROCEDURE trigger
    en error 306: "number or type of arguments are wrong in POPULATE_BLOCK"
    I post the trigger auto generated by Forms Builder 6i...
    DECLARE
    bk_data DATABANKER_TIPOLOGIE.TIPTABLEOFREC;
    BEGIN
    DATABANKER_TIPOLOGIE.leggi3(bk_data);
    PLSQL_TABLE.POPULATE_BLOCK(bk_data, 'BLOCCO50'); -- <- error here
    END;
    How can I solve this problem? Maybe there is a bug?
    P.S. I'm using Oracle Database 9i

    CREATE or REPLACE PACKAGE DATABANKER_TIPOLOGIE AS
    TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    PROCEDURE leggi(resultset IN OUT TipTableOfRec);
    END DATABANKER_TIPOLOGIE;I have solved with this replacement 1) -> 2)
    1) TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE;
    2) TYPE TipTableOfRec IS TABLE OF I_TIPOLOGIA%ROWTYPE
    INDEX BY BINARY_INTEGER;
    with 2) now works.
    Now I have stored-procedures for query, insert, delete
    and update.
    I have some problems with delete and update of the records
    because it seems that they are locked.
    I think that it is due to the absence of lock
    stored-procedure... there's someone that can help me with
    the lock SP implementation?

  • Forms inserts rather update on commit_form when changes made in records

    I have created a form in forms builder 10g. These are 3 tables.
    1. Recovery_Shift (Production Shift Information) -- Parent Table
    2. Recovery_Size (Many Size in one Production Shift) -- Child to Table- 1
    3. Recovery_Size_Dtl (Details of the Size Recovered) -- Child to Table- 2
    The form has been created using 3 datablocks correpsonding to the above tables in two canvases.
    In second canvas I have a "Save" Push Button with code "Commit_Form". Whenever I am inserting first time it is ok. After pressing this push button if I make any changes in any record and press the Save button, forms shows unique constraint error. When I disable this constraint in table. The form inserts a new duplicate row in the table.
    The problem is ==>if I make any changes in the form after pressing "Save" button (Commit_form) it inserts the whole row rather updating the row.
    What could be the cause and solution. Please guide. The module is at implimentation stage. Thanks in advance for guidance.
    Tables for your references.
    Table - 1. Recovery_Shift
    SHIFT_ID----------NUMBER(10,0)     --> PK
    RECOVERY_DATE-----DATE     
    SHIFT-------------VARCHAR2(1 Bytes)     
    SHIFT_START_TIME--DATE     
    SHIFT_END_TIME----DATE     
    SUPERVISOR--------VARCHAR2(6 Bytes)     
    OPT---------------VARCHAR2(6 Bytes)     
    ENTRY_BY----------VARCHAR2(6 Bytes)     
    ENTRY_DATE--------DATE     
    VALIDATE_BY-------VARCHAR2(6 Bytes)     
    VALIDATION_DATE---DATE     
    SHIFT_MINUTE------NUMBER(10,0)     
    Table - 1. Recovery_Size
    SIZE_ID-----------NUMBER(10,0)     --> PK
    SHIFT_ID----------NUMBER(10,0)     --> FK
    REJ_STAGE---------VARCHAR2(2 Bytes)     
    ITEM_SIZE---------NUMBER(7,2)     
    ITEM_CLASS--------NUMBER(4,2)     
    ITEM_GROUP--------VARCHAR2(2 Bytes)     
    ITEM_QUALITY------VARCHAR2(3 Bytes)     
    RECOVERED_MTR-----NUMBER(10,2)     
    RECOVERED_TON-----NUMBER(10,3)     
    AUCTION_MTR-------NUMBER(10,2)     
    AUCTION_TON-------NUMBER(10,3)     
    ITEM_SPEC---------NUMBER(2,0)     
    Table - 1. Recovery_Size_Dtl
    SIZE_ID-----------NUMBER(10,0)     --> FK
    LEN_MIN-----------NUMBER(4,2)     
    LEN_MAX-----------NUMBER(4,2)     
    REC_AUC-----------VARCHAR2(1 Bytes)     
    PCS---------------NUMBER(10,0)     
    MTR---------------NUMBER(10,2)     
    TON---------------NUMBER(10,3)     
    SEGMENT-----------VARCHAR2(1 Bytes)
    Message was edited by:
    Vinay Pandey

    for inserting a row it asks for commitThat is normal behavior. When you update or create a record in the Recovery_Size_Detail block, you must commit the record before working on another record.
    I think it may be the cause of problem that there are already saved (commited)records in the form when i am entering more records in 2nd & 3rd table and commiting them.If you are creating new records after the commit, and these new records are duplicates in the database, then the unique constraint error is expected. If you want to ensure the user is not creating duplicate records before trying to commit, then see this:
    http://sheikyerbouti.developpez.com/duplicates/duplicates.htm
    You might try creating the form with just two blocks:
    First block (master): Recovery_Shift
    Second block (detail) Recovery_Size
    Get that to work and test it by updating and creating records. After you are pleased that it works, save it and then add the 3rd block as a detail block for the the 2nd block. Then you have this:
    Block1. Recovery_Shift (master)
    Block2. Recovery_Size (detail for block 1 and master for block 3)
    Block3. Recovery_Size_Detail (detail for block 2)

  • Oracle forms 10g,multiple insert and update problem

    Hi,
    I have tabular form(4 records displayed) with one datablock(based on a view).
    After querying the form could not update all the records but only first record value can select from LOV.
    I called a procedure in in-insert and on-update
    The query is lik this
    PACKAGE BODY MAPPING IS
         PROCEDURE INSERT_ROW(EVENT_NAME IN VARCHAR2)
         IS
         BEGIN
              IF (EVENT_NAME = 'ON-INSERT') THEN
                   INSERT INTO XX_REC_MAPPING
                   (BRANCH_CODE,COLLECTION_ID,PAY_MODE_ID,RECEIPT_METHOD,CREATED_BY,
                   CREATION_DATE,LAST_UPDATED_BY,LAST_UPDATE_DATE,LAST_UPDATE_LOGIN)
                   VALUES
                   (     :XX_REC_MAPPING.OFFICE_CODE,
                        :XX_REC_MAPPING.COLLECTION_ID,
                        :XX_REC_MAPPING.PAY_MODE_ID,
                        :XX_REC_MAPPING.RECEIPT_METHOD,
                        :XX_REC_MAPPING.CREATED_BY,
                        :XX_REC_MAPPING.CREATION_DATE,
                        :XX_REC_MAPPING.LAST_UPDATED_BY,
                        :XX_REC_MAPPING.LAST_UPDATE_DATE,
                        :XX_REC_MAPPING.LAST_UPDATE_LOGIN);     
              ELSIF (EVENT_NAME = 'ON-UPDATE') THEN          
              UPDATE     XX_REC_MAPPING
              SET BRANCH_CODE=:XX_REC_MAPPING.OFFICE_CODE,
                        COLLECTION_ID=:XX_REC_MAPPING.COLLECTION_ID,
                        PAY_MODE_ID=:XX_REC_MAPPING.PAY_MODE_ID,
                        RECEIPT_METHOD=:XX_REC_MAPPING.RECEIPT_METHOD,
                        LAST_UPDATED_BY=:XX_REC_MAPPING.LAST_UPDATED_BY,
                        LAST_UPDATE_DATE=:XX_REC_MAPPING.LAST_UPDATE_DATE,
                        LAST_UPDATE_LOGIN=:XX_REC_MAPPING.LAST_UPDATE_LOGIN
                        WHERE ROWID=:XX_REC_MAPPING.ROW_ID;
              END IF;
         END INSERT_ROW;
    END MAPPING;
    Whether the table gets looked or sholud i use some other trigger or loops ?
    someone suggest me how to edit this query for multiple update.
    Thanks
    sat33

    I called a procedure in in-insert and on-updateWhy are you writing this code in the first place? If you have a block based on an updatable view, just let Forms do the inserts and updates.
    If it's not an updatable view, use instead of triggers on the view.
    See this current thread too:
    INSTEAD of Trigger View for an Oracle EBS New form development

  • Wanna create a different application to update employee information.!!!!!!

    Well i have transferred an xcel sheet to oracle10g and created and application using forms 6i. The thing is some fields in excel sheet gets updated every month.
    Like:HOLIDAYS AVAILABLE, HOLIDAYS AVAIL,EVALUATION.
    I wanna create a seperate application to update this specific tables in oracle10g using 6i.
    FOR EX.Once concerned person gets the monthly xcel sheet he just needs to type the emp number and enter the associated values in the respective fields clicks UPDATE button the old value gets over written(update) with the new value.
    I would really be glad if some one could provide me with a code to update tables in oracle 10g using 6i for even one column i.e HOLIDAYS AVAILABLE .......
    The thing is i am a newbie in the field of forms n report...!!!!!!!!!!!!! and i m on a probation period here...so plz guyz i desperately need helppppppppppppppppppppp!!!!!!!!!!!!!!!!

    Hi!
    - open the forms builder, connect as user who owns the desired table
    - create a new form (file - new - form) in the menu, give it a name and save it
    - in the navigator click on datablocks
    - click the green +* in the left vertical toolbar
    - use the datablock wizzard to create a new block (basing on a database table)
    - choose table or view and click next
    - in the table or view field type the table name and click refresh
    - put every desired field in the field database objects and click next
    - do not use the relation screen and click next
    - give the datablock a name or keep the default. Click Finish ^(?: my forms is german ...)^
    - The layout wizzard getting started. Choose "new canvas" and click next.
    - choose the columns you want to see in your form. click next
    - May change the field-prompts, width and height. This can be done later too. click next
    - choose if you want to display the fields like a form or like a grid. click next
    - forms will create a border around your fields. Choose the title, displayed records and if you want a scrollbar. click next
    - choose Finish and look at this nice screen :)
    Save the form (ctrl-s) and compile it (ctrl-t).
    - let it run! (ctrl-r)
    - press F8. If there is already data in your table, you will see the first record or more.
    Be careful! if your table is a production table, changing values in the fields
    and save (commit) the changes will immediate change the data in the database table.
    Good luck and have fun !
    Regards

  • When button pressed, update

    I have a criteria as
    I created a button 'cancel' with 'when_button_pressed' trigger. IF i press the button cancel , then the table should be updated setting the cancelled_flag column to 'YES' Which is initially by default as 'NO'.
    But when i press the button the present row is updating at the same time there is another row created.
    This cancellation is dependent on the list item called 'Booking Type'.
    IF booking type is General then the cancelled_flag corresponding to the general booking should be updated or else
    if the booking type is franchisee then the cancelled_flag corresponding to the franchisee booking should be updated.
    But here the cancel button works fine with franchisee booking. but when ever i try to cancel the booking type of general , there is the above mentioned problem.
    It is an automatically created form with underlying datablock as general_booking table, and the code is like this
    when_button_pressed trigger
    BEGIN
         IF :booking_type = 'General' THEN
         UPDATE kspb_regular_booking
              SET cancelled_flag = 'YES',
              amount_refund = :amount_refund,
              cancelled_by = :cancelled_by
              ,cancelled_no = :pass_no
              ,cancelled_on = :cancelled_on
              WHERE pass_no = :pass_no;
              commit;
         ELSIF :booking_type = 'Franchisee' THEN
              UPDATE kspb_franchise_booking
              SET cancelled_flag = 'YES',
              amount_refund = :amount_refund,
              cancelled_by = :cancelled_by
              ,cancelled_no = :pass_no
              ,cancelled_on = :cancelled_on
              WHERE pass_no = :pass_no;
         END IF;
         commit;
    END;
    The datablock of the form is from the table regular_booking only.
    please some one help

    But here the cancel button works fine with franchisee booking.
    but when ever i try to cancel the booking type of general , there is the above mentioned problem.To wild guess
    Maybe you have a block on a kspb_regular_booking table, and you do a data entry on some item of it
    Insert an ON_insert trigger on that block
    with
    begin
    NULL;
    end;
    and try,

  • Updating a text field in  aform based on conditions

    Hi ,
    We are developing a custom form which has a database datablocks.
    This form is a master detail form . It has a field called "status" whose initial values is 'Draft' and this field is present in the master part of the form.
    The Logic for "Draft" is written in Pre-Insert trigger of the header block.
    Question
    If condition "A" is met and "B" is met , status should be set as a value called as 'Submitted';
    If condition a is not met and B is met , status should be set as a value called as 'Created';
    We are doing this in the post-update trigger at block level. But the changes are not taking effect.
    Please let us know if this is the correct approach to handle the column. Note that the column "Status" is a database column.
    Thanks and Regards
    SR

    The above is not working
    Let me restate the problem statement
    Hi ,
    We are developing a custom form which has a database datablocks. This form is a master detail form . It has a field called "status" whose initial values is 'Draft' and this field is present in the master part of the form.
    The Logic for "Draft" is written in Pre-Insert trigger of the header block.
    Question
    The record is created with a status of Draft initially.
    Query and requery back and if condition is met , the value of status should be updated as follows......Condition A and B involves going an chekcing in some other table and based on that , we set the status column....
    If condition "A" is met and "B" is not met , status should be set as a value called as 'Submitted';
    If condition "A" is not met and B is met , status should be set as a value called as 'Created';
    We are doing this in the post-update trigger at block level. But the changes are not taking effect.
    Please let us know if this is the correct approach to handle the column. Note that the column "Status" is a database column.
    Also tried the following
    1) When validate item at block level by capturing the item in a parameter and then assigning the parameter to the status column in pre-update column . This is not working
    Thanks and Regards
    SR
    ----------------------------------

  • Requery form data block is empty after updating notification attributes

    Hello,
    we build a form to approve/reject open WF notifications.
    The form data block is based on wf_notifications,
    wf_local_user_roles, wf_notification_attributes and wf_comments and some additional PSB tables.
    We use the following API's to perform the update:
    wf_notification.SetAttrText( nid => l_notification_id
    , aname => 'RESULT'
    , avalue => l_result);
    wf_notification.respond(nid => l_notification_id
    ,responder => name_in('FORM_GLOBALS.USER_NAME')
    ,respond_comment => name_in('FORM_GLOBALS.REDEN_AFWIJZING') );
    First the query shows 3 notifications and after updating one notification as shown above a requery is performed on the datablock and no records are shown anymore.
    If I remove the code wf_notification.SetAttrText then the 2 remaining notifications are shown.
    It looks like the wf_notification.SetAttrText is conflicting with my view.
    This is my view:
         SELECT distinct 'B'||pbr.budget_revision_id mutatienummer
    , pbr.budget_revision_id
    , xp.dienst
    , pbr.justification mutatiereden
    , pbr.requestor aanvrager_id
    , nvl(fu_req.DESCRIPTION, fu_req.USER_NAME) aanvrager
    , pbr.CREATION_DATE aanvraag_datum
    , wlur.USER_ORIG_SYSTEM_ID user_id
    , wlur.user_name user_name
    , wn.notification_id notification_id
    , wn.subject subject
    , wn.message_type wf_item_type
    , pbr.ATTRIBUTE2 transactiesoort
    , pbr.ATTRIBUTE4 categorie
    , pbr.ATTRIBUTE5 raadsvoorstel
    , SUBSTR(pbr.attribute1, 4) begrotingsstuk
    , SUBSTR(pbr.attribute3, 4) status
    , SUBSTR(pbr.attribute6, 4) dienstgroep
    , SUBSTR(pbr.attribute7, 4) concerngroep
    , decode(SUBSTR(pbr.attribute3, 4),'Bij D.C.',null,nvl(fu_from.DESCRIPTION, fu_from.USER_NAME)) Fiatteur_bij_DC
    , decode(nvl(pbr.attribute9,'X'),nvl(pbr.attribute10,'Z'),'J','N') initiele_structuur_wijz
    , decode(pbr.ATTRIBUTE2,'Structuurwijziging','J','N') structuurwijziging
         , pbr.budget_group_id budget_group_id
         , xrb.bedrijf aangevraagd_door_dienst
         , wn.begin_date datum_melding
         , pbr.attribute8 te_wijzigen_kst_dr_prod
         , pbr.attribute9 oude_structuur
         , pbr.attribute10 nieuwe_structuur
         , pbr.attribute11 ingangsjaar_struct_wijz
         , to_date(fnd_date.canonical_to_date(pbr.attribute12)) ingangsdatum_struct_wijz
         , pbr.attribute13 looptijd_mutatie
    from wf_notifications wn
    , wf_local_user_roles wlur
    , wf_notification_attributes wna
    , psb_budget_revisions pbr
    , fnd_user fu_req
    , fnd_user fu_from
    , wf_comments wc
    , psb_budget_revision_lines pbl
    , psb_budget_revision_accounts pbra
    , gl_code_combinations gcc
    , xxpsb_parameters_vw xp
    , psb_budget_group_resp bgr
         , xxpsb_respons_bedrijf_vw xrb
    where wn.message_type = 'PSBBR'
    and wn.message_name = 'NOTIFY_APPROVERS_OF_SUBMISSION'
    and wn.status = 'OPEN'
    and wlur.role_name = wn.recipient_role
    and wna.notification_id = wn.notification_id
    and wna.NAME = 'BUDGET_REVISION_ID'
    and pbr.BUDGET_REVISION_ID = to_number(wna.number_value)
    and wlur.USER_NAME = fnd_profile.value('USERNAME')
    and fu_req.user_id = pbr.requestor
    and fu_from.user_name(+) = wc.from_user
    and wc.notification_id(+) = wn.notification_id
    and pbr.budget_revision_id = pbl.budget_revision_id
    and pbl.budget_revision_acct_line_id = pbra.budget_revision_acct_line_id
    and pbra.code_combination_id = gcc.code_combination_id
    and gcc.segment1 like xp.code||'%'
    and bgr.budget_group_id = pbr.budget_group_id
    and bgr.responsibility_id(+) = xrb.responsibility_id
    and bgr.responsibility_type = 'R'

    Hi Mat,
    the attribute is only set for those notifications which are selected in the form.
    l_notification_id is filled with the notification_id of the selected record.
    This is the piece of code within the process loop:
    l_notification_id := name_in('WERKLIJST.NOTIFICATION_ID');
    l_result := name_in('FORM_GLOBALS.NOTIFICATION_ACTION');
    wf_notification.SetAttrText( nid => l_notification_id
    , aname => 'RESULT'
    , avalue => l_result);
    wf_notification.respond(nid => l_notification_id
    ,responder => name_in('FORM_GLOBALS.USER_NAME')
    ,respond_comment => name_in('FORM_GLOBALS.REDEN_AFWIJZING')
    Regards
    Rinus

  • Whats the best way to check table before form deletion or update ?

    Hi, I have a func_staff table made up of a composite key - func_no and staff_id. I have a form where the datablock references this table.
    I need to be able to check that before a func_no and staff_id combination on the form are written to the database that that combination does not already exist in the table.
    What would be the code for that ? I've tried stuff like IF EXIST statements and even a select statement but I totally worded it it wrongly.
    To DELETE an entry in that same table, would the best way to be create an LOV for both func_no and staff_id, the problem with that would be if a user selected a combination that does not exist ? Could I create a combined LOV that would populate each field ?? (this way I could be 100% sure that the selected combination is valid)
    Thanks Peeps.

    hi,
    you can try and use the count(*), before deleting and updating
    lets say
    select count(*)
    into l_count
    from table_name
    where column1 = :block.column1
    and column2 = :block.column2;
    if l_count <> 1
    then
    insert into..........
    else
    show error message;
    raise form trigger failure;
    end if;
    similarly u can use l_count before deleting.
    regards,
    Mayank

Maybe you are looking for

  • Dreamweaver CC 2014 won't launch

    Just switched to a new Mac Pro. Per Adobe's instructions, I downloaded and installed Creative Cloud. Then from Creative Cloud I selected the Adobe apps to install. Several of the apps run just fine--no issues. However, no matter what I try, I can't g

  • HT5622 Ipad 3 version 6.1.3 will not let me use iMessage or FaceTime!

    "Sign in with you Apple ID..." I do and I get a message that says "Could not sign in. Please check your network conn. and try again" I can use the safari app on my ipad and browse the internet. I am able to use iMessage and FaceTime on my Iphone 4 so

  • What's the best place to start troubleshooting my Xserve RAID problem

    Hello all, I have an older 2.5tb (ide drives) Xserve RAID connected to an HP workstation, which is a video editing sytem. The fiber card connecting the raid is an LSI 7202XP PCI-x card. I'm using Windows XP Pro. Nothing on the hardware or software si

  • Adobe Acrobat Pro DC

    Hello, I Think I made a mistake 2 days ago... I would like to have Adobe Export PDF and I make a command for Adobe Acrobat Pro DC...

  • Is it Possible to View Album info on my TV

    I have all the necessary gear to view videos and photos on my TV (and can view) but can't seem to get the album art or song title etc. to come up on the TV monitor while playing music. Is there something i'm doing wrong or is it evan posible? If it's