Formula URL Button Error Code 2 for all users but me

  • 0
  • 1
  • Question
  • Updated 2 months ago
  • Answered
I am trying to add a button to a form to change the value of a text field on the same record to a specific value when the button is clicked.  It works perfectly for me, and when I initially implemented it, I thought I had tested it for all other users, successfully.

However, several other users, all of whom are authorized users in the app, and all of whom have read, write, and delete access to the table in question have come back to me saying that when they attempt to use the button, they get the following error:

<qdbapi>
<link type="text/css" id="dark-mode" rel="stylesheet" href=""/>
<style type="text/css" id="dark-mode-custom-style"/>
<action>API_EditRecord</action>
<errcode>2</errcode>
<errtext>Invalid input</errtext>
<errdetail>
[User] can edit data but you're testing as that user, so your change wasn't saved
</errdetail>


<rid>21</rid>
<num_fields_changed>0</num_fields_changed>
<update_id/>

</qdbapi>

Now, when I click the button, it works, but when I test as any other user, it does not.

This is my button code:

URLRoot() & "db/" & Dbid() &
"?act=API_EditRecord&apptoken=hb83yebjxiy9yb9csgmqgstsss&_fid_44=Approved&rid="
&[Record ID#]
& "&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() & "?act=dr&rid=" & [Record ID#])


I have tried it with and without apptokens enabled, and have attempted to get it to work with user tokens instead of app tokens, but have not seen any change in results.  

I'm losing my mind just a little bit here.  If the users can access the app, can access and edit the table, why does this button only work for me?

How can I get it to work for all users?

Thanks!

Jason

Photo of Jason Kuczek

Jason Kuczek

  • 80 Points 75 badge 2x thumb
  • Frustrated

Posted 2 months ago

  • 0
  • 1
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 11,406 Points 10k badge 2x thumb
Hi Jason,

When testing as another user you would get that error as the Test as User functionality does not allow you to Edit or Save anything even if that user can. It is a limit put in place to avoid confusion when an Admin testing as a user saved something and then it showed as that User's action. Are the other users who use this button also getting the same test as user error or are they getting another error? Do they ever try to use that button while testing as a user themselves?
Photo of Jason Kuczek

Jason Kuczek

  • 80 Points 75 badge 2x thumb
Hello Evan,

I had suspected that testing as the other users was not a good strategy.  That limitation makes sense.  After getting your response, I went back and had the users test logged in as themselves and they are no longer getting the error.  I suspect I had their permissions set incorrectly initially, corrected that problem, but because I was testing as them rather than having them logged in directly, I was unable to detect that the problem was resolved.  Thank you for your help!

Jason
Photo of Evan Martinez

Evan Martinez, Community Manager

  • 11,406 Points 10k badge 2x thumb
Hi Jason,

I am really glad that suggestion was helpful and they were able to make use of the button. Thank you for your time today. 
(Edited)