Page 1 of 1

Fail to create related records

PostPosted: Thu Mar 17, 2011 9:27 am
by falcon7
I am building a purchase order tracking system. I want to have a table all the POs, with a one-to-many relationship to a table with the individual items in a PO. I have two tables, purchases and reqitems, with the following file in .../tables/purchases:
[bill of materials]
__sql__ = "SELECT * FROM reqitems WHERE reqid = '$reqid'"

reqid is a field in each table, and is indexed in each table.

In the Xataface interface, the 'bill of materials' comes up correctly for a record in purchases, and I am offered the opportunity to insert a new record. However, whenever I fill in the fields and hit Save, the input screen clears, and no record is created.

Anyone have an idea what might be wrong?

thanks,
James

Re: Fail to create related records

PostPosted: Thu Mar 17, 2011 9:44 am
by shannah
One thing is that xataface doesn't like spaces in relationship names. This could be causing a problem. If you want spaces in the relationship tab you could use the action:label directive.
e.g.
Code: Select all
[bill_of_materials]
  __sql__ = "...."
  action:label="Bill of Materials"



-Steve

Re: Fail to create related records

PostPosted: Thu Mar 17, 2011 10:10 am
by falcon7
Excellent, that solved the problem. Thanks!