Forum Discussion

PaulElliott's avatar
PaulElliott
Qrew Member
2 months ago

Strange Problem with Button to mark check box

I've used this same concept in multiple places and they work correctly.  I have a couple of apps, and the current app is giving me a strange error message.  I'm hoping someone can give me advice on handling this.

Code from Button:

var text url = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
    "&rid=" & [Record ID#] &
    "&apptoken=d7s84zwcx5qf79csb72q6wrdjkd" &
    "&_fid_20=1" &
    "&rdr=" & //redirect parameter
    //URLEncode("https://exteriorsutah.quickbase.com/db/bug9w4puk"); URL meaning
    URLEncode(URLRoot()&"db/"&"bug9w4puk"&"?a=er&rid=" & [Related Invoice Header]); // Takes them to the invoice header in view mode, dr is view mode er is edit mode
    "<a class='Vibrant Primary' style=\"width:160px; text-align: center;\" href='" & $url & "'>Select for Pay</a>"

Error code being received:

<qdbapi>

<errtext>Invalid request - we cannot understand the URL you specified.</errtext>

<errcode>102</errcode>

<errdetails>ac0fb69d-e405-9558-bc99-a5a04c6ca98e:</errdetails>

</qdbapi>

 

Thank you,
Paul Elliott

Exteriors Utah, LLC

 

  • I suggest that you use the table name like [_DBID_INVOICE_HEADER].  It's possible that you have used the application ID and hence the  bug9w4puk is incorrect.

    You get that from the advanced settings for the invoice header table.  In fact the best practice is to always use a reference to the table as opposed to hard coding the Table ID or even the application ID because that way when you copy the app the button will still work.  

     

    var text url = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" &
        "&rid=" & [Record ID#] &
        "&apptoken=d7s84zwcx5qf79csb72q6wrdjkd" &
        "&_fid_20=1" &
        "&rdr=" & //redirect parameter
        //URLEncode("https://exteriorsutah.quickbase.com/db/bug9w4puk"); URL meaning
        URLEncode(URLRoot() & "db/" & [_DBID_INVOICE_HEADER] & "?a=er&rid=" & [Related Invoice Header]); // Takes them to the invoice header in view mode, dr is view mode er is edit mode
        "<a class='Vibrant Primary' style=\"width:160px; text-align: center;\" href='" & $url & "'>Select for Pay</a>"

     

     

     

    • PaulElliott's avatar
      PaulElliott
      Qrew Member

      That didn't solve the problem, but I got it working this weekend.  

      Thanks for the help Mark

  • Paul,

    What changed?   Can you share the error / development issue?

    • PaulElliott's avatar
      PaulElliott
      Qrew Member

      I tried so many things, but I think that there's a possibility that the $url was the problem, but don't think that is what solved it.  As odd as it sounds, I think that the key was, I removed the Rich Text text from the bottom of the formula.

  • Worst part was, once I got it working correctly, I was testing things and decided that the check box could be checked using the pipeline I was building and no longer needed to have it triggered manually.  So, I'm not even using the button.  

  • There are lots of things that I used to string together a bunch of API calls.  I then started using KeithJusas tool Juice Triggers for a few years.   Now I reach for a Pipeline.