Skip to main content
Question

Combine 4 URL's in one button

  • March 15, 2019
  • 0 replies
  • 168 views

Forum|alt.badge.img+5
I have 4 URLs that each work fine by themselves.  I downloaded the URL Formula Buttons for dummies and can combine three of the URLs using that example.  However, I need to add a fourth url to the button and I can't figure out the syntax.

Below is listed what I have so far.

var text DeliveryDateInOS =
    URLRoot() & "db/xxx?a=API_EditRecord" &
    "&rid=" & URLEncode([DeliveryOrderSched]) &
    "&apptoken=XXX" &
    "&_fid_7=" & URLEncode([Dumpster Delivery Date] & " 12:00am") &
    "&_fid_18=" & URLEncode([Dumpster Delivery Date] & " 12:30am");

var text PickUpDateInOS =
    URLRoot() & "db/xxx?a=API_EditRecord" &
    "&rid=" & URLEncode([PickupOrderSched]) &
    "&apptoken=XXX" &
    "&_fid_7=" & URLEncode([Dumpster Pick-up Date] & " 1:00am") &
    "&_fid_18=" & URLEncode([Dumpster Pick-up Date] & " 2:00am");

var text ProcessRec =
    URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Order Number] &
    "&apptoken=XXX" &
    "&_fid_77=0" &
    "&_fid-434=1"&
    "&_fid_447=1"&
    "&_fid_79=" & URLEncode(Trim(ToText([Dumpster charge - DumpsterCost]))) &
    "&_fid_169=" & URLEncode(Max([ZipCodeReference - MileageCharge],0)) &
    "&_fid_71=1" ;

$DeliveryDateInOS &
"&rdr=" & URLEncode($PickupDateInOS) & 
URLEncode("&rdr=" & URLEncode($DeliveryDateInOS)) &
URLEncode("&rdr=" & URLEncode(URLRoot() & "db/" & Dbid()&"?a=dr&rid="&[Order Number]))

Obviously, I  have overwritten the DBID and the AppToken for each url.

Can anyone shed some light on what I am doing wrong?
This topic has been closed for replies.

My recommendation with that much going on is you're better off in the long run just writing some quick javascript to accomplish your goal. Makes it much easier to scale if you want to add a 5th, or 6th... so on. 

Your syntax in a url button would look like:

"javascript: {" & 
"$.get('" & $DeliveryDateInOS  & "');" & 
"$.get('" & $PickUpDateInOS   & "');" &
"$.get('" & $ProcessRec & "');" &
"window.location.replace('" & URLRoot() & "db/" & Dbid()&"?a=dr&rid="&[Order Number]) & "');" & 
"}"

The $.get() commands will call out to perform the editRecord Calls - then when complete it does your redirect via window.location.replace. Quick note if you go this route and want to add to it - make sure you're putting single quotes in your $.gets() - its a little hard to see written above. So the real syntax looks like $.get(' but since its a quick base formula it has to have double quotes for the formula like "$.get('"


Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base

The other syntax is this to execute sequential URL calls

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


You define the formula variables and need to end with one that displays a record or a report.

But Chayce, yours could probably be made more generic for the situation where you want to refresh whatever page you are on.  That way it would be more flexible to be used on a record or a report or an embedded child table on a form and be superior to mine for that situation.  Is there a change to yours possible which would do that?





Forum|alt.badge.img+5
  • Author
  • Registered
  • March 15, 2019
Thank you both so much.  I have beat my head against the wall trying to figure this out.