Forum Discussion

DanteTognoli's avatar
DanteTognoli
Qrew Captain
3 years ago

URL button not saving

I am using a URL button to edit part of a record I am currently working on. If I don't save first and I press the button, QB initiates the save dialogue on it's own but then gives me the following error after I tell it to save:

<qdbapi>
<action>API_EditRecord</action>
<errcode>30</errcode>
<errtext>No such record</errtext>
<errdetail>Missing "rid" parameter.</errdetail>
</qdbapi>

If I save the record first using the built in save button on the form my URL button works just fine. I don't understand why the auto-save feature is throwing the error.

URL button is as follows:

URLRoot() & "db/" & [_DBID_FLIGHT__DUTY_AND_REST] & "?a=API_EditRecord&rid=" & URLEncode ([Record ID#])//& "&z=" & Rurl()
& "&_fid_370=" & Now()
& "&_fid_269=VALID SIGNATURE"
& "&_fid_376=" & [Pilot Initials] & " " & Now()
& "&rdr=" & URLEncode(URLRoot() & "db/" & [_DBID_FLIGHT__DUTY_AND_REST] & "?a=dr&rid=" & URLEncode ([Record ID#])

------------------------------
Dante Tognoli
------------------------------

4 Replies

  • This part of the code

    "?a=API_EditRecord&rid=" & URLEncode ([Record ID#])

    says to edit the record and then provides the [Record ID#] to edit.  The [Record ID#] does not exist until after you save, so you are trying to edit record "blank".


    ------------------------------
    Mark Shnier (YQC)
    mark.shnier@gmail.com
    ------------------------------
    • DanteTognoli's avatar
      DanteTognoli
      Qrew Captain
      I understand that part. I don't understand why it doesn't work when the system dialogue is saving it first (or perhaps it is not?) and then running the button. When I click my URL button it says "You've made changes to this Record. Do you want to save these changes before going to the next screen?". When I hit save I get the error. If it is saving first, shouldn't the record exist?



      ------------------------------
      Dante Tognoli
      ------------------------------
      • MarkShnier__You's avatar
        MarkShnier__You
        Icon for Qrew Legend rankQrew Legend
        If you were to observe the URL in the Browser, you will see that its locked into a editing record ID# =  blank (or perhaps 0), so it saves the record because you asked it to, and then it continues with the next step in the URL which is to edit record ID# 0.  The URL does not have a chance to change after the record is saved.

        ------------------------------
        Mark Shnier (YQC)
        mark.shnier@gmail.com
        ------------------------------