Skip to main content
Question

URL Button to Open New Window

  • September 15, 2017
  • 0 replies
  • 147 views

Forum|alt.badge.img+5
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!!! 
This topic has been closed for replies.

Can you clarify what is to Open in a new window, the child record?

  • Registered
  • September 15, 2017

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

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.

Forum|alt.badge.img+5
  • Author
  • Registered
  • September 15, 2017
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! 

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. 

Forum|alt.badge.img+5
  • Author
  • Registered
  • September 15, 2017
Address?

:)
mark.shnier@gmail.com

It can be electronic.  Or just an email.