Discussions

 View Only
  • 1.  URL for opening grandparent record

    Posted 12-19-2018 22:46

    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 :)


  • 2.  RE: URL for opening grandparent record

    Posted 12-20-2018 00:14
    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.




  • 3.  RE: URL for opening grandparent record

    Posted 11-03-2020 09:25
    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
    ------------------------------



  • 4.  RE: URL for opening grandparent record

    Posted 11-03-2020 09:29
    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
    ------------------------------



  • 5.  RE: URL for opening grandparent record

    Posted 11-03-2020 09:44
    1. Great thanks
    2. You're right - I missed your last line there (Formula Below)
    3. I change the field type
    4. You're right I reference the wrong field there - I wanted the related Grandparent ID through the middle or junction table which is called Survey.


    var text URL = URLRoot() & "db/" & [_DBID_IDSS] & "?a=dr&rid=" & [Survey - Related IDS]"<a href=" & $URL & ">" & $Words & "</a>"

    Now the error is in bold - "a variable declaration must end in a semi colon"

    ------------------------------
    Jack Woods
    ------------------------------



  • 6.  RE: URL for opening grandparent record

    Posted 11-03-2020 10:52
    Try this

    var text Words = [lookup field from the grandparent to the parent to the grandchild to identify the Grandparent];

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

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

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



  • 7.  RE: URL for opening grandparent record

    Posted 11-03-2020 11:04
    That worked. I might be back later with another case. I'm working with the magic buttons app and am try to make some cool things happen :)

    ------------------------------
    Jack Woods
    ------------------------------



  • 8.  RE: URL for opening grandparent record

    Posted 11-03-2020 11:23
    Yes, Kirk has some great examples there.

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