Add record through cross-app relationship

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

I am trying to create a button that my Sales reps can click from the "Opportunities" table in our sales app that will direct them right to the "Add Quote" form in our project management app and relate the new quote to the opportunity.  I know how to do this within the same app, but can't figure out how to do this across different (but related) applications.  Here is what I have so far, but keep getting an error saying the DBID_QUOTES is not a field in the Opportunities table:

URLRoot() & "db/" & [_DBID_QUOTES] //name of the "child" table in project mgmt app

& "?act=API_GenAddRecordForm&_fid_69=" & URLEncode ([Record ID#]) // connecting the child to its parent...here [Record ID#] is the key in parent (Opportunities) and _fid_69 is the related parent in the child (Quotes)

& "&_fid_48=" & URLEncode([Related Client]) //parent field I want to copy into the new child record


Any help is appreciated!

Photo of Jennifer

Jennifer

  • 10 Points

Posted 4 years ago

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

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
In a cross app relationship you have to specify the Part of the file path which defines your table explicitly, exactly how it appears from the native app.
So where you have the [_DBID_QUOTES] instead you need to have

& "/aaaaabbb123"

If that was the URL path you see in the URL in the native record.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
I'm not sure without testing if you need that leading /
Photo of Jennifer

Jennifer

  • 10 Points
Thank you so much Mark!  You are always so helpful :)
Photo of AJ

AJ

  • 112 Points 100 badge 2x thumb
Thanks! I used this to create a button to add new record in a table in a separate app, but I'm having a problem from there - the new record doesn't automatically associate with the record I start in. For instance, I have a "Files" table in one app and an "Orders" table in another app. When I click the "Add Order" button, a new record is generated in the Orders table, but its not associated with the File I clicked from. This is the formula I'm using:

URLRoot() & "db/bj889dpxv?a=API_GenAddRecordForm&_fid_2=" & URLEncode ([Record ID#])& "&z=" & Rurl()

Any help would be really appreciated! Thanks in advance.

AJ
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
You are trying to populate field ID# 2 in that formula.  Field ID 2 is not the field for [Related Parent]. In fact it would be the field for [Date Modified] which is a system generated field that you may not update.
Photo of AJ

AJ

  • 112 Points 100 badge 2x thumb
Thanks! I misunderstood what that was pointing at (thinking it was the form). I switched it to the related file field and it works. I appreciate the help!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 65,280 Points 50k badge 2x thumb
:). It's all obvious in hind site!