Discussions

 View Only
Expand all | Collapse all

URL Button to Open New Window

QuickBaseCoach Dev./Training

QuickBaseCoach Dev./Training09-15-2017 00:15

MCF Neil

MCF Neil09-15-2017 00:16

Todd Molino

Todd Molino09-15-2017 01:05

QuickBaseCoach Dev./Training

QuickBaseCoach Dev./Training09-15-2017 01:09

  • 1.  URL Button to Open New Window

    Posted 09-15-2017 00:09
    I have a formula URL button that when pressed, creates a child record and refreshes the record, however I need it to then open a new window. Here's what I have thus far:

                var text URL = URLRoot() & "db/XXX?act=API_AddRecord" & "&apptoken=XXX"& "&_fid_14="  & URLEncode ([Record ID#])
                             & "_&_fid_16=" & URLEncode ([Current User Name])
                             & "_&_fid_17=" & URLEncode ([Current User Email])
                             & "_&_fid_6=" & URLEncode (Now());

    "javascript:" &
    "$.get('" & 
    $URL & 
    "',() => location.reload(true));"


    Going nuts here trying to figure this out for a client. Any help or input would be greatly appreciated and worthy of a Christmas card for life. If I'm unclear, just ask me and I'll answer any questions you have. Thanks!!! 


  • 2.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:15
    Can you clarify what is to Open in a new window, the child record?


  • 3.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:23
    Thanks for the quick reply!! 
    The child record is created and then the User should be automatically redirected to the refreshed parent record in a new window.


  • 4.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:16


  • 5.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:24
    Opening target in new window will not work in this case because of the injected Java script. Thanks though!! 


  • 6.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:22
    This will create the child and if you click the box a box that Matthew indicated above, the child will display in a new window.

    URLRoot() & "db/XXX?act=API_AddRecord" & "&apptoken=XXX"& "&_fid_14="  & URLEncode ([Record ID#])
     & "_&_fid_16=" & URLEncode ([Current User Name])
     & "_&_fid_17=" & URLEncode ([Current User Email])
     & "_&_fid_6=" & URLEncode (Now())
    & "&disprec=1


  • 7.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:26
    Box is checked and I tried the code, however it didn't open in a new window


  • 8.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:30
    Are you trying to display the child in the new window or the parent.


  • 9.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:31
    Note that in my post above, it is just that code, not the javascript stuff. Don't include the javascript.


  • 10.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:32
    Parent. The code I currently have Uses the URL variable to create the child record and uses the subsequent JS to refresh the parent afterward. So if it opens in a new window at any point,  at this point I'll be happy. lol


  • 11.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:34
    var text URLONE =
    URLRoot() & "db/XXX?act=API_AddRecord" & "&apptoken=XXX"& "&_fid_14="  & URLEncode ([Record ID#])
     & "_&_fid_16=" & URLEncode ([Current User Name])
     & "_&_fid_17=" & URLEncode ([Current User Email])
     & "_&_fid_6=" & URLEncode (Now());


    var text URLTWO = URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Record ID#];

    $URLONE
    & "&rdr=" & URLEncode($URLTWO)


    .... and set that  checkbox to open in a new window.


  • 12.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:44
    Well, what can I say! You da man!! It worked! Can't tell you how thankful I am for you helping so quickly. I didn't know I could do a redirect after adding a record. I thought it had to be saved. 
    Looking forward to getting some sleep now. Thanks again! 


  • 13.  RE: URL Button to Open New Window

    Posted 09-15-2017 00:50
    The first night of Chanukah is December 12th.  I will watch my mail for my card.  

    as for redirects, I have an app in the exchange called URL formuals for dummies.  You can do a lot of nested redirects.


    $URLONE 
    & "&rdr=" & URLEncode($URLTWO)
    & URLEncode("&rdr=" & URLEncode($URLTHREE))
    & URLEncode(URLEncode("&rdr=" & URLEncode($URLFOUR)))
    & URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLFIVE))))
    & URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSIX)))))
    & URLEncode(URLEncode(URLEncode(URLEncode(URLEncode("&rdr=" & URLEncode($URLSEVEN))))))

    The very last one needs to display a record or report so the user does not see the XML success message, which is not user friendly. 


  • 14.  RE: URL Button to Open New Window

    Posted 09-15-2017 01:05
    Address?


  • 15.  RE: URL Button to Open New Window

    Posted 09-15-2017 01:09
    :)
    mark.shnier@gmail.com

    It can be electronic.  Or just an email.