Forum Discussion

HeatherBryant2's avatar
HeatherBryant2
Qrew Assistant Captain
7 years ago

URL for opening grandparent record

I?m working with three tables: Use Profiles, Sites, and Reports.

-        Sites is a parent to Reports

-        User Profiles is a parent to Sites

The User Profiles table has a Quick Base username field that I use as the reference proxy in the User Profiles to Sites relationship.

I?ve created a lookup field, Sites ? Related User ID , in the Reports table that pulls the Related User ID from the Job Sites table lookup field Related User.

What I?d like to happen is that a user can be on a Report record, and click a button to open their profile in the Users Profile table in edit and additionally mark a checkbox field as true.

I messed around with trying to utilize the Sites ? Related User ID at the end of a URL in a formula URL field but couldn?t get it right.

Thanks :)
  • No problem,

    When you need to link from one record to another and there is not an easy way to get there, then you just build your own hyperlink. 

    Because I'm all about Stupid Simple (KISS) I always build them in the same format.

    var text URL = URLRoot()  & "db/" & [_DBID_Table name that you get from Advanced properties in square brackets] & "?a=dr&rid=" & [Record ID# of the grandparent table]; // always end a formula variable with a semi colon.

    var text Words= [Some lookup field brought down to identify the Grandparent];

    // then this part is always the same (KISS)

    "<a href=" & $URL & ">" & $Words & "</a>"

    That will display the Grandparent record.  (a=dr means action = Display Record).  You can also do a=er  (Action = Edit Record), however when you save it might land you somewhere unexpected if you go directly into edit mode.


    • JackWoods's avatar
      JackWoods
      Qrew Trainee
      Hey,

      I tried to use this formula to get into the grandparent record as well and it doesn't seem to be working. You don't mention it in the comments but I used a formula URL field. not sure which formula field I need to create the hyperlink. 

      var text URL = URLRoot() & "db/" & [_DBID_IDSS] & "?a=dr&rid=" & [Related IDS];


      This is the formula that I came up with from your breakdown and I seem to get an error... "A variable declaration must end with a semi-colon"

       also, what do you mean by "[_DBID_Table name that you get from Advanced properties in square brackets]" I found the "Table Alias" in advanced settings and assumed that's what you're talking about but want to make sure.


      ------------------------------
      Jack Woods
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        1. Yes, I meant the Table Alias.
        2. Can you post your complete formula, it looks like you just posted part of it.
        3. The field type should be formula Rich Text.
        4. The Record ID that you will want to display is the Record ID# of the Grand Parent record.  I'm not sure if what's in the field  [Related IDS] is the Record ID# of the Grand Parent .. is it?

        ------------------------------
        Mark Shnier (YQC)
        Quick Base Solution Provider
        Your Quick Base Coach
        http://QuickBaseCoach.com
        mark.shnier@gmail.com
        ------------------------------