Skip to main content
Question

button to create a record that is not a child

  • April 11, 2019
  • 0 replies
  • 46 views

I've got a parent table (Cases) with two different child tables (Activities and Tasks).

I figured out how to create a button in Tasks that creates a new Activity. (Go me!)

What I can't figure out is how to map fields (for example, to grab the parent Case from the Task and make it the parent Case on the Activity).

Here is the formula I have so far. I copied it from one of the automatic "Create Child" buttons that are created when you create the relationship, and then I changed the name of the table. I didn't know what else to change.

URLRoot() & "db/" & [_DBID_ACTIVITY_SUMMARY] & "?a=API_GenAddRecordForm&_fid_22=" & URLEncode ([Record ID#])& "&z=" & Rurl()
This topic has been closed for replies.

Forum|alt.badge.img+12
  • Quickbase Alumni
  • April 11, 2019
Either:
(to create an Activity connecting it to the Case from a Task without connecting it to the Task)

URLRoot() & "db/" & [_DBID_ACTIVITY_SUMMARY] & "?a=API_GenAddRecordForm&_fid_xx=" & URLEncode ([Related Case])
& "&z=" & Rurl()

or 
(to create an Activity from a Task connecting it to both the Task and the Case)

URLRoot() & "db/" & [_DBID_ACTIVITY_SUMMARY] & "?a=API_GenAddRecordForm&_fid_xyz=" & URLEncode ([Record ID#])
& "&_fid_abc=" & URLEncode ([Related Case])
& "&z=" & Rurl()


xx and abc is going to be the [Related Case] (reference) field ID# in your Activities table (connecting it to Cases)

xyz is going to be the [Related Task] (reference) field ID # in your Activities table (connecting it to Tasks)

If, when the User saves the new Activity records, you want them to stay in the new Activity rather than go back to the Task they came from; then remove the & "&z=" & RURL() from your formula.

  • Author
  • Quickbase Alumni
  • April 11, 2019
Worked beautifully. Thank you!!!!!!!!!!!!!!!!

  • Author
  • Quickbase Alumni
  • April 11, 2019
Followup question: I also want the text in the field "Task" to become the text in the field "Subject" (fid 15) in the new Activity. I tried adding to the formula as follows, but I'm getting an error message. What did I do wrong?

URLRoot() & "db/" & [_DBID_ACTIVITY_SUMMARY] & "?a=API_GenAddRecordForm&_fid_20=" & URLEncode ([Related Case #])&_fid_15=" & URLEncode ([Task])

Sarah,

A couple of resources to learn this syntax stuff are my app in the exchange called URL Formuals for Dummies and also Kirk Trachy's "Magic Buttons App".

Mark


  • Author
  • Quickbase Alumni
  • April 12, 2019
Okay, here's a new challenge. :)

Now I want the button to "Mark Complete and Create Activity." Complete is a checkbox in the Tasks table, fid 9.

Here is where my formula stands now. What do I add to have it mark the task as complete?

URLRoot() & "db/" & [_DBID_ACTIVITY_SUMMARY] & "?a=API_GenAddRecordForm&_fid_20=" & URLEncode ([Related Case #])&"&_fid_15=" & URLEncode ([Task])