Forum Discussion

AaronLavender's avatar
AaronLavender
Qrew Trainee
3 years ago

Table Relationships

I have a table named Projects.  There are two child tables named Options and PO's.  From the Add PO form I'd like to be able to "Add Options" to the options table by clicking on an "Add Option" button.  The trouble I'm having is that when I click "Add Option" from the Add PO form, the "Add Option" form doesn't relate (auto-populate) the Project that the PO is related to, the related project field is blank and I have to manually type it in.  I can't figure out how to relate the tables and fields so that the "Add Option" form knows which Project it's creating records for.

Any suggestions are appreciated.

------------------------------
Aaron Lavender
------------------------------
  • Can you clarify the relations you have?  Is options a child of POs as well as Projects?

    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • AaronLavender's avatar
      AaronLavender
      Qrew Trainee
      Hey Mark, thanks for replying.  I do not have a relationship created between PO's and Options (Job Options).



      ------------------------------
      Aaron Lavender
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        Try this

        try this as a button on Purchase Orders  

        URLRoot() & "db/" & [_DBID_OPTIONS] & "?act=API_GenAddRecordForm&_fid_99=" & [Related Project]

        you will need to check the Properties of the Options table to check if I guessed at the correct _DBID and also check the field ID number for the Related Purchase Order field in options and change the 99 placeholder to that field ID  




        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------