If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!

If you need to insert a record into a table where you have a foreign key that references a primary key that is not yet created, you can open a secondary form, insert the row that create the primary key and then submit the primary form and insert the initial record. I'm not good in English. Please try it and you will understand. Thank you.

To download the sample application click here Enjoy!

Related slices

Comments (2)

  • Login to post

  • 0
    linhtinh 13 years ago
    I try but not understand how it work. Can you explain more detail. I think instead of specific table, we can write the general with params are table and field. Dont know that is right or wrong.

  • 0
    villas 14 years ago
    Very useful and the app worked well. It would be good to combine with an autocomplete (maybe slice 66). I notice that a similar theme arose in the group a couple of times. Just for reference: 3 Oct 2009 "Add" button next to "combo box". 20 Feb 2010 "Ajax" Thanks!

Hosting graciously provided by:
Python Anywhere