Forum Discussion

IvanWeiss's avatar
IvanWeiss
Qrew Captain
6 years ago

XML view after button press

The following code is generating a view of the XML results in lieu of the actual redirect.  What did I screw up here lol

//Trigger Automation to Import Estimating Tasks
var text UrlImportEstimating = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Project Number] &
"&apptoken=c5gchf9bhwx6umbd2ii5zdqtb5x8" &
"&_fid_173=true" &
"&_fid_94=" & URLEncode("The estimating tasks have been imported from the template.") &
"&rdr=" & URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Project Number];

var text ButtonImportEstimating="<a class='" & [EliteButtonClass] & $STYLE & "href='" & $UrlImportEstimating & "'" & ">Import Estimating Tasks</a>";
//----------------------------------------------------------------------------------------

------------------------------
Ivan Weiss
------------------------------
  • Ivan,
    The generral syntax for successive URL calls is this

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

    So the issue with your formula is that you need to URLEncode after the  redirect 

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

    My practise is to put the different URLs into formula variables and then I can just reuse the same syntax.

    BUt to fix your code owuld be

    //Trigger Automation to Import Estimating Tasks
    var text UrlImportEstimating = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&rid=" & [Project Number] &
    "&apptoken=c5gchf9bhwx6umbd2ii5zdqtb5x8" &
    "&_fid_173=true" &
    "&_fid_94=" & URLEncode("The estimating tasks have been imported from the template.") &
    "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?a=dr&rid=" & [Project Number]);

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------
    • IvanWeiss's avatar
      IvanWeiss
      Qrew Captain
      Ah I thought I didnt need the URLEncode if I was including it in the first "code" and not separating.  I will add that, thanks!

      ------------------------------
      Ivan Weiss
      ------------------------------