Forum Stats

  • 3,854,206 Users
  • 2,264,340 Discussions
  • 7,905,609 Comments

Discussions

why cannot I use hidden or display only item to store value for insert?

lxiscas
lxiscas Member Posts: 276
edited Apr 11, 2013 10:27AM in APEX Discussions
hi, Gurus:

I have a question:

I implemented a form with report region in a page, the update works OK, but the add function has a problem:

There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)

Many Thanks in advance.

Sam

Best Answer

  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited Apr 11, 2013 10:27AM Answer ✓
    Hi,
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
    I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.

    Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.

    Howard

    Congratulations. Glad you found the solution.

    Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM

Answers

  • Howard (... in Training)
    Howard (... in Training) Member Posts: 905
    edited Apr 11, 2013 10:27AM Answer ✓
    Hi,
    There is a column, offender_ID, which is a foreign key for another table, it should not be null during insert. However, even I pass the offender ID from master page when user click the create button, and it did shows in the form, it must be a text filed to insert successfully, why cannot I use hidden or display only item to store this value for insert? (If I use hidden or display only item, insert won't be successful, apex reports I tried to insert a null value to offender_ID column.)
    I think both hidden and display items have attributes that can cause problems because of different ways these items function than non-hidden and non-display-only items function. Display Only items have a "Setting" of "Save Session State" Yes/No? That can be a problem.

    Would you do this? Make these items regular items instead and see if you can get those working. Then, we will try to change the fields back to hidden or display only.

    Howard

    Congratulations. Glad you found the solution.

    Edited by: Howard (... in Training) on Apr 11, 2013 10:26 AM
  • lxiscas
    lxiscas Member Posts: 276
    Thank you. I just noticed the display only item should set with save session state. Problem solved.


    Sam
This discussion has been closed.