Discussions

Expand all | Collapse all

URL button not saving

  • 1.  URL button not saving

    Posted 13 days ago
    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
    ------------------------------


  • 2.  RE: URL button not saving

    Posted 13 days ago
    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
    ------------------------------



  • 3.  RE: URL button not saving

    Posted 13 days ago
    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
    ------------------------------



  • 4.  RE: URL button not saving

    Posted 13 days ago
    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
    ------------------------------



  • 5.  RE: URL button not saving

    Posted 13 days ago
    Gotcha, so there is no record # yet and the save dialogue is trying to save the record I am currently looking at and run the URL button at the same time (essentialy)​

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