How do I automatically relate multiple parents to a child?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered

I have the tables Companies > Contacts > Events > Activities

I'd like the all of the related information to automatically flow downstream. So when I'm in an Event and click Add Activity, the related Company and Contact are chosen as well. Is that a form rule? Or something I have to encode in the button?

Photo of Josh

Josh

  • 40 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 62,994 Points 50k badge 2x thumb
Yes, this can be encoded in the button (and I can help you on this forum if you really need it), but can I ask why?  Do you have a relationship that "skips" the levels, ie a direct relationship where 1 Company has many Activities?  Normally, what you do is to do lookups of any fields from the Company fields down to the Contacts, and then from there if you need those field(s) on the Event you look them up from the Contact down to the Event, and then again from the Event down to the Activity.
Photo of Josh

Josh

  • 40 Points
I do have relationships that skip levels, like in your example.

I was really struggling to find the documentation on how to send the information around the way I was wanting. Hopefully to help other people here's what worked for me:

URLRoot() & "db/" & [_DBID_TASKS] & "?a=API_GenAddRecordForm&_fid_128=" & URLEncode ([Record ID#])
& "&_fid_171=" & URLEncode([Related Contact])
& "&_fid_169=" & URLEncode([Related Company])
& "&z=" & Rurl()

I had to piece together how to do this from a couple of places because it wasn't clear anywhere I could find by searching.

But the syntax seems to be: & "&_fid_FieldID#ofWhatYouWantToEncodeInNewRecord=" & URLEncode([Parent record field name you want to pass down])