Passing parameters from Child Record when creating a new Parent Record using built-in functionality

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered
I'll try to make this as simple as possible.

I have 2 parent tables (CUSTOMERS and CUSTOMER PARTS) and one child table that links the 2 parents (TRANSACTIONS). TRANSACTION table has Related CUSTOMER and Related CUSTOMER PART).

CUSTOMER PARTS is, in turn, a child to PARTS. PARTS has all the parts our company carries, and CUSTOMER PARTS captures parts that are priced for each customer.

Therefore, the relationship is as follows:

PARTS < CUSTOMER PARTS < TRANSACTIONS > CUSTOMER
(each PART has many CUSTOMER PART records, and each CUSTOMER PART can appear in many TRANSACTION records; each TRANSACTION record belongs to one CUSTOMER. NOTE: Although not visible in the relationships above, there is also a one-to-many relationship between CUSTOMER and CUSTOMER PARTS).

Activity takes place in the TRANSACTIONS table, and all goes well when selecting an existing Related Customer Part from a drop-down menu. However, when a PART has not been priced for a CUSTOMER (meaning it does not exist in CUSTOMER PARTS), it needs to be added at the time of creating the Transaction. QuickBase provides the "<Add a new customer part...>" link at the bottom of the related Customer Part drop-down list which is great; however, in the pop-up form that opens users are required to select the "Related Customer" when adding the CUSTOMER PART on the fly.

So the question is...

Is there a way to pass the Related Customer value from the TRANSACTIONS Table to CUSTOMER PARTS when adding a new record on the fly using the QuickBase built-in functionality? I know that this can be easily accomplished using a custom button to add the new record and including this value. However, when using a custom button the Customer Part does not become automatically selected in the Transactions form, nor does it become immediately available in the drop-down (unless the form is refreshed).

Any input or suggestions will be greatly appreciated.

Thanks in advance.

[Additional Information]

Let's say it's not the record ID, but any other parameter... is it possible to pass parameter values from a child record to a parent record when creating the new parent record using the Qbase built-in (<add new record...>) functionality?


Photo of Juan

Juan

  • 20 Points

Posted 6 years ago

  • 0
  • 1
Photo of Jack

Jack, Champion

  • 50 Points
Hi, I would say no, as you haven't saved the record therefore there is nothing to pass. Until you save the transaction (i.e. the parent record) there isn't anything to associate it with the linking table or any of its fields such as customer. The only way I can think of would be to either save the record first or add a formula url button using the api functions.
Photo of Juan

Juan

  • 20 Points
Let's say it's not the record ID, but any other parameter... is it possible to do so from a child record when creating a new Parent record using the Qbase built-in functionality?
Photo of Jack

Jack, Champion

  • 50 Points
The issue is you will need to save the child record first before you can copy across any values, as they aren't in the field values in the database until you save them. You could use the rdr (redirect) to effectively save the form and redirect it back into edit mode then run your add record (all on the same button so would run automatically), your values should then be passed correctly providing you are passing the record id for the customer (or other primary key value if not the record ID) to the reference field for customer in the customer parts table. If you also then also copy the transaction record id across you can create another button when the part/s is selected to save the record and take the user back to the transaction in edit/view mode. Hope this makes sense.