Non DB item in a base table block, gives frm-40202 error.

Dear All,
We are using forms6i as a front end. To simulate the error, consider the following example.
1.Create a multirecord emp block.
2.Add a non database item in the base table block.
3.Assign any value to the non database item, in the when new record instance trigger.
4.When i say F7 or F8, my block asking me like, field must be entered. Which means, my record status changed to Insert. But there is no change in base table record, since i modified only in the non base table item.
Please validate, whether i am doing anything wrong in my technique.
Regards,
Balaji

If you have a value to be used as the default value then you can use "Initial Value" property in the item level for the Non Database Item. If you do this it wont give you any problem during the query. If you create a new record then the value which you have put as the default will come automatically.

Similar Messages

  • Assigning a Value to a Base Table BLock Field

    hi,
    I have a form in which a block is a base table block . i need to change the value of a field. currently it shows the value of a field from the Table on which the block is based . I need to change the value of that field to display some other value of another table.
    i have a written select statement like this
    select name into vname from ws_emp where ecode = 101
    then i have assigned to this base table field
    :bt_person.ti_v_name := vname;
    this i have created in the base table blocks Post query
    but it is not assigning value
    pls correct me and suggest me if there is any other better method to do this
    Sarav

    That SHOULD work in the Post-Query trigger of the block, but doing that is never a good idea. By replacing a base-table field with any value, it causes Forms automatic processing to lock the row immediately, so no other person running your form can call up the same data. And it causes Forms to think you need to update the record, so the record's status is changed to 'CHANGED' from 'QUERY'.
    It would be better to create a non-base-table field in the block, and put the name into that field.

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

  • Updating a Base Table Block Record

    We have a form where there is a multi array base Table block. this is used for generating employee number for various depts. the columns are like this with some sample data
    Dept Start No end No Start Date End Date
    sales 1001 1100 01-Jun-2009 31-12-2050
    Accts 2001 2100 01-Jun-2009 31-12-2050
    HR 3001 3100 01-Jun-2009 31-12-2050
    and the data is populated from its table. These Data were created at the backend while implementation and is not modified for some long time. Now the client wants to modifiy the data . i.e they want to add new set of Start nos and End nos for the existing Dept So they will add at the bottom of the Block
    like this
    sales 1101 1200 01-Apr-2011 31-12-2050
    when they add this the end date of the existing record should get modified with sysdate as they add the new records. at any time they can add new set of numbers of any number of depts.
    can u please guide me how to do this ?

    If I understand correctly, you need to take the following data:
    Dept  Start No   end No   Start Date   End Date
    sales 1001       1100     01-Jun-2009  31-12-2050
    Accts 2001       2100     01-Jun-2009  31-12-2050
    HR    3001       3100     01-Jun-2009  31-12-2050and change it so it is like this:
    Dept  Start No   end No   Start Date    End Date
    sales 1101       1200     01-Apr-2011   31-12-2050
    when they add this the end date of the existing record should get modified with sysdate as they add the new records.First, I will assume you are using Oracle Forms (since your question was in the Forms forum) but you didn't specify a version. In Forms, you could easily put this logic in the Block Pre-Inser t Trigger. You'll have to set the SYSDATE through DML rather then requery the block after changes are saved. This is easier than trying to find the existing record in the block and setting the SYSDATE.
    at any time they can add new set of numbers of any number of depts.Is this data used for anything more than just reference? If so, what is the key value and how does making changes like this affect the existing data and relationships?
    Just from the small description you gave, the process sounds very closed - meaning it is not easily changed. If this is true, than you probably need more than just "Use a Pre-Ins Trigger" answer. You also need to know how to update all of the related records that just changed because of the new department number and for this answer we'll need more information. ;)
    Craig...

  • A list of values type item in a based table block

    My block is based on a table. An item of the block take the value of a field of the table when the form raises. But this item must be updateable (by selecting a value in a list) and then it must be of the list of value type. And the values in the list of values come from another table (not the based table). Is it possible ? If it is, how can I do this ?
    Thank you !

    Yes, it's possible. Just use a regular text item. Create an LOV using the LOV wizard. When you define the query for the LOV's record group, enter a statement that selects from the other database table. Set the return value of the appropriate LOV column to be the text item on the form. Finally, assign the LOV to that text item, so that the LOV pops up when the user presses the LOV key with the cursor in that text item. You can also set the LOV so that it automatically displays when the cursor enters the text item.
    Just look up LOV in online help if you need more info.

  • Order by on Non-base table Item

    Hi,
    I have a base table block on Dept and some of the non-base table items(which are emp table and being populated through post-query).
    So, i have some base table items and non-base table items on the same block.
    No my problem is, i have to do ORDER BY on one of non-base table items..
    How can i do this ?
    Thanks in advance.

    The obvious answer is to create a view upon which to base the block, or alternatively you could use a FROM Clause Query so that you don't have to set the values in your POST-QUERY trigger.
    Richard

  • Non-base tables

    What is non-base table when refered in forms ?
    null

    moorthy kathirava (guest) wrote:
    : What is non-base table when refered in forms ?
    When you create a Block/form without any base table, ie., Form
    containing controls which are not necessarily related to one
    table is called non base table block/form.
    Murugan
    null

  • Non-Database items in enter-query mode

    I have a form with 2 base table blocks, typical master details situation. I wish to allow a field from the detail block to be queryable from the master block. I was considering adding a non-database item to the master block (visible only when in Enter-Query mode). In a pre-query trigger I would amend the DEFAULT-WHERE property of the master block when the appropriate where clause using the non-database item value. My prototype/test version works fine except the non-database item is not enabled while the master block is in enter-query mode.
    I think basically forms will enable only field s if they are database items and queryable set to yes. There are no more database items I can use to set the non-database item column name property.
    Any suggestions would be appreciated.
    Ralph
    Oracle Developer - Unisys Australia

    Hi Ralph,
    we have several Forms using non-database items as query-items which works fine.
    What we did is following:
    1) create non-database item xy in master-data-block
    2) set property database item to no
    3) set property query allowed to yes
    4) create a pre-query trigger on master-data-block where we change the where-clause (this is forms6i, in 9i we would use the one-time-where-clause)
    Peter

  • How to update base view Block

    Hi,
    I have a View ( is based on more than one table) and created base table block based on that view.
    Question is, how can I update and save the data from Oracle forms ?
    I'm using Oracle forms 4.5 and Oracle8.0.6 database.
    Thanks in advance.

    Hi James
    Form based on Complex views:
    Records can be updated by writing the code in ON-UPDATE Trigger,
    Code for Inserting a record can be written in ON-INSERT trigger
    For delete u can write the code in ON-DELETE or KEY-DELREC (this worked for my form)
    Locking the rows can be done by ON-LOCK trigger.
    Here is the sample code....
    try to write a package and in that package write procedure for, insert, update, delete, lock, Call those procedures in your trigger which should be on your block level. Block's property that you have to set is: go to the property pallette:
    LOCKING MODE: IMMIDIATE
    KEY MODE: UPDATEABLE
    CODE FOR INSERT:
    --change field names according to your field names
    Package Spec:
    PACKAGE XXCPCRQM_PKG IS
    PROCEDURE insert_row;
    PROCEDURE update_row;
    PROCEDURE delete_row;
    PROCEDURE lock_row;
    END;
    Package Body:
    PACKAGE BODY XXCPCRQM_PKG IS
    --Procedure to Update Row into cpt_ar_charge_to_master table
    PROCEDURE update_row IS
    BEGIN
    UPDATE cpt.cpt_ar_charge_to_master
    SET
    ACCOUNT = :XXCPCRQM_BLK.ACCOUNT,
    SUFFIX = :XXCPCRQM_BLK.SUFFIX,
    REPORT_CODE = :XXCPCRQM_BLK.REPORT_CODE,
    CHARGE_TO_ACCOUNT = :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX = :XXCPCRQM_BLK.CHARGE_TO_SUFFIX,
    CREATION_DATE = :XXCPCRQM_BLK.CREATION_DATE,
    CREATED_BY = :XXCPCRQM_BLK.CREATED_BY,
    LAST_UPDATE_DATE = :XXCPCRQM_BLK.LAST_UPDATE_DATE,
    LAST_UPDATED_BY = :XXCPCRQM_BLK.LAST_UPDATED_BY
    --WHERE ROWID = :XXCPCRQM_BLK.ROW_ID;
    WHERE CHARGE_TO_ID = :XXCPCRQM_BLK.CHARGE_TO_ID;
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT UPDATE RECORD');
    raise form_trigger_failure;
    commit;
    END;
    --Procedure to Insert Row into cpt_ar_charge_to_master table
    PROCEDURE insert_row IS
    BEGIN
    INSERT INTO cpt.cpt_ar_charge_to_master
    (CHARGE_TO_ID,
    ACCOUNT,
    SUFFIX,
    REPORT_CODE,
    CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX,
    CREATION_DATE,
    CREATED_BY,
    LAST_UPDATE_DATE,
    LAST_UPDATED_BY)
    VALUES
    (cpt_chrg_to_id_s.nextval, -- Sequence
    :XXCPCRQM_BLK.ACCOUNT,
    :XXCPCRQM_BLK.SUFFIX,
    :XXCPCRQM_BLK.REPORT_CODE,
    :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT,
    :XXCPCRQM_BLK.CHARGE_TO_SUFFIX,
    :XXCPCRQM_BLK.CREATION_DATE,
    :XXCPCRQM_BLK.CREATED_BY,
    :XXCPCRQM_BLK.LAST_UPDATE_DATE,
    :XXCPCRQM_BLK.LAST_UPDATED_BY);
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT INSERT RECORD');
    raise form_trigger_failure;
    commit;
    END;
    --Procedure to Delete rows from cpt_ar_charge_to_master
    PROCEDURE delete_row IS
    BEGIN
    DELETE FROM cpt.cpt_ar_charge_to_master
    WHERE charge_to_id = :XXCPCRQM_BLK.charge_to_id;
    EXCEPTION
    when NO_DATA_FOUND
    then
              fnd_message.debug('CAN NOT DELETE RECORD');
              raise form_trigger_failure;
    commit;
    END;
    PROCEDURE lock_row IS
    Counter NUMBER;
    CURSOR C IS
    SELECT
    CHARGE_TO_ID,
    ACCOUNT,
    SUFFIX,
    REPORT_CODE,
    CHARGE_TO_ACCOUNT,
    CHARGE_TO_SUFFIX
    FROM cpt_ar_charge_to_master
    WHERE charge_to_id = :XXCPCRQM_BLK.CHARGE_TO_ID
    FOR UPDATE of CHARGE_TO_ID NOWAIT;
    Recinfo C%ROWTYPE;
    BEGIN
    Counter := 0;
    LOOP
    BEGIN
    Counter := Counter + 1;
    OPEN C;
    FETCH C INTO Recinfo;
    if (C%NOTFOUND) then
    CLOSE C;
    FND_MESSAGE.Set_Name('FND','FORM_RECORD_DELETED');
    FND_MESSAGE.Error;
    Raise FORM_TRIGGER_FAILURE;
    end if;
    CLOSE C;
    if (
    (Recinfo. CHARGE_TO_ID = :XXCPCRQM_BLK.CHARGE_TO_ID)
    AND ( (Recinfo. ACCOUNT = :XXCPCRQM_BLK.ACCOUNT)
    OR ( (Recinfo. ACCOUNT IS NULL)
    AND (:XXCPCRQM_BLK.ACCOUNT IS NULL)))
    AND ( (Recinfo.SUFFIX= :XXCPCRQM_BLK.SUFFIX)
    OR ( (Recinfo.SUFFIX IS NULL)
    AND (:XXCPCRQM_BLK.SUFFIX IS NULL)))
    AND ( (Recinfo.REPORT_CODE = :XXCPCRQM_BLK.REPORT_CODE)
    OR ( (Recinfo.REPORT_CODE IS NULL)
    AND (:XXCPCRQM_BLK.REPORT_CODE IS NULL)))
    AND ( (Recinfo.CHARGE_TO_ACCOUNT = :XXCPCRQM_BLK.CHARGE_TO_ACCOUNT)
    OR ( (Recinfo.CHARGE_TO_ACCOUNT IS NULL)
    AND (:XXCPCRQM_BLK.CHARGE_TO_ACCOUNT IS NULL)))
    AND ( (Recinfo.CHARGE_TO_SUFFIX = :XXCPCRQM_BLK.CHARGE_TO_SUFFIX)
    OR ( (Recinfo.CHARGE_TO_SUFFIX IS NULL)
    AND (:XXCPCRQM_BLK.CHARGE_TO_SUFFIX IS NULL)))
    ) then
    return;
    else
    FND_MESSAGE.Set_Name('FND','FORM_RECORD_CHANGED');
    FND_MESSAGE.Error;
    Raise FORM_TRIGGER_FAILURE;
    end if;
    EXCEPTION
    When APP_EXCEPTIONS.RECORD_LOCK_EXCEPTION then
    IF (C% ISOPEN) THEN
    close C;
    END IF;
    APP_EXCEPTION.Record_Lock_Error(Counter);
    END;
    end LOOP;
    END lock_row;
    END XXCPCRQM_PKG;
    CALLING FROM TRIGGER:
    ON-INSERT: XXCPCRQM_PKG.insert_row;
    I am sure this will help you.
    Thanks
    Madhu

  • Populate non database items with lov

    Hi,
    Let's say that I have one database block with 2 columns ID and NAME.
    Only ID it is a not displayed database column, and NAME it is a displayed text item with an lov which retrieve data for both columns.
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.
    Thanks.

    Hi Gabriel
    How can I do, to populate the non database item NAME after querying the block, without using POST-QUERY trigger and select into statement.u can't do that but with using POST-QUERY trigger and select into statement.
    This Trigger fires the action of populating the non-db item block Level after executing query...
    Regards,
    Amatu Allah

  • Why empty query if non-db items populated??

    Can anyone tell me why having a block with non-database items, when preassigned before entering block, would result in an empty query for the rest of the database items in the block?
    In a when-button-pressed trigger I assign values to the non-db items in the new block. When I do this, the query returns nothing. If I comment out those assignment commands, it queries fine. why??

    Hi Anthony,
    Did you get a FRM-40402 error - Field must be entered? If you did, you probably have a (Primary Key) mandatory field in the block.
    Anyway, what is the reason for assigning values to the non-db items before executing a query?
    Regards,
    John

  • Problem in  BOM or component allocation for the Non- codified Item in a PO.

    Hi All,
    Please advise how to explode a BOM or Assign component in a Purchase order with Item category (L) for a Operation oriented material for which no material code is created from a production order .
    Actually in my scenario, no raw material component will send to the Sub -Contract Vendor. Only Assembled operation material lets say operation 20 from a routing ( which is not having material code ) from an In - house production from a shopfloor has to be sent to the vendor to create a operation 30 material , which is also not having a material code." How to explode a BOM or component allocation for the Non- codified Item in a PO".
    Kindly give me the IMG settings for the above scenario.
    regards,
    YK

    Hi Prasobh,
    Tnx for your suggestion. But, the client external processing routing is not constant activity . Based on the Operation bottlenecks client is sending the operation as external Processing. For Eg., If on first order operation 20 be external , Then in second order operation 20 need not be external. operation 30 may go out for external processing. Client does not want a material code for each operation.
    Give your valuable suggestion.
    regards,
    YK

  • FRM-40202 and mandatory items on a multi-tab canvas

    Hi all !
    Short technical question for you guys : let's say that I have datablock whose fields are displayed on different tabs of a same tab canvas. Now, let's say that two fields of this datablock are defined as mandatory : one on the first tab, the other on the last.
    My problem is that my form doesn't behave correctly :
    Good behavior -> After creating a record on the first tab without filling the mandatory record of the last tab, if I try to create a new record => I get a FRM-40202 error, and Forms forces me to fill the mandatory field of the last tab. Nice.
    Bad behavior -> After creating a record on the first tab, I try to go to the last tab by clicking the appropriate tag name in order to fill the mandadory field => I get a FRM-40202, and Forms leaves me on the first tab, unable to fill in my record properly. I thought that as long as I wasn't leaving my record, I wasn't supposed to get a FRM-40202 error...
    How would you deal with this kind of error ? How can I get this kind of error while not leaving the record ?
    Thanks for your ideas and your help
    Regards,

    Hi,
    are you sure you're not navigating to another record or block? (or trying to save...) Make sure it enabling debugging messages or tracing it...
    The error message in thiscase is clear...
    Regards,
    Jose L.

  • Ordering a block by a non-base table field

    Hello,
    I have heard you can order your block by a
    non-base table field by using a stored function. Does anyone know how to do this?
    Lisa

    In a WHEN-VALIDATE-ITEM user have to press ENTER or TAB key too !!
    anyway he have to press something.
    KEY-NEXT-ITEM and KEY-PREVIOUS-ITEM is a good choice.
    You can create a timer who fire each second, verify that user enter something new in the field (by comparing old and new value), then do execute_query

  • Want to sort the records based on non-base table item

    I have a multi-record block and I am trying to sort the data based on nbt item
    I have a table called X which has x_type,x_code fields.
    The table on which the block is created is Y. the table Y has x_type and y_desc as its fields
    form layout is like below .the x_type is key field on which I have to query the records
    and x_code is a non-base item in the form.I want to sort the records by X_code.
    x_code y_desc
    A     xyz
    c par
    B     lmn
    my pre-query has this code
    select x_type from y
    where
    x_type := x_type;
    post-query has this code
    select x_code from x
    where x_type = :x_type;     
    It works fine in Enter-Queryand execute query mode. but when I am sorting the records on
    nbt item x_code by SET-BLOCK-PROPERTY it doesn't do any thing

    Hi Tony ,
    I have created a function and in Pre-Query & have add this
    SET_BLOCK_PROPERTY('b1', ORDER_BY, 'fn_get_code(x_type)');
    and the function created is as below
    Function fn_get_code (p_x_type in varchar2) return varchar2 is
    v_code varchar2(40);
    begin
    select x_code into v_code
    from X, Y
    where X.x_type = Y.x_type
    and y.x_type = p_x_type
    return v_code;
    end;
    when I run the form and execute query it comes up with the error message
    FRM-40505 and when I pressed display error it shows
    SQL Statement error:
    SELECT ROWID,X_TYPE,X_CODE
    FROM Y order by fn_get_code(x_type)
    Error:
    "ORA-00904: "FN_GET_code": invalid identifier"
    Is it that I need to create a function on the database?. As I have created function
    in program unit section

Maybe you are looking for

  • HT4759 i miss my iphone 4 yesterday so how can i get

    i miss my phone so i don't know what i should do weather i get back my phone so i need help if u could so , i am so worried about how to find

  • Mass Maintain for F-04 Post For Clearing

    Hi SAP Expert, Is there any mass maintain for transaction F-04 Post For Clearing i have about 1500 data ( debit and credit ). if i do manually entering i need to enter about 1500 times  then save the document, i have using LSMW to pum the 1500 line i

  • Excel cfcontent not working after 2003 upgrade

    Have a section of code that exports to excel using cfcontent tag: Worked fine for everyone, except now we started upgrading to excel/office 2003 and it no longer shows any data. Loads a blank spreadsheet everytime. Tried changing to: <cfcontent type=

  • Problem in using BLOB and callablestatement

    Hi I am doing an insert into the database , of which one of the clomn is BLOB when i do it using prepared statement , it does it fine but if i do it using the callable statment (Stored procedure)its not doing it ..... and gives an error like below do

  • Re:Reg table control

    Hi,    i have 2 fields in table control. flag                     ship1 if flag =y               then i should have this column enabled for writing in table    control   other wise disable     how to implement logic for it