Forum Discussion

SMK's avatar
SMK
Qrew Trainee
24 days ago

Cancel and Go Back Button

Hi Everyone, I'm new to Quickbase and could use some help.

I'm building an application with two related tables:

  • Price Request (Header Table)
  • Attachments Table (Each Price Request can have multiple attachments)

I've created a form in the Price Request table with an "Add Attachment" button that routes users to the Attachment form, allowing them to upload documents. Here's the formula I'm using for that:

URLRoot() & "db/" & [_DBID_ATTACHEMENTTABLE] & "?a=API_GenAddRecordForm&_fid_7=" & URLEncode([Record ID#]) & "&z=" & Rurl()

Now, I want to add a "Cancel and Go Back" button on the Attachment form that:

  1. Deletes the current attachment record.
  2. Redirects the user back to the related Price Request record.

Here's the formula I tried:

URLRoot() & "db/" & Dbid() & "?a=API_DeleteRecord"
& "&rid=" & URLEncode([Record ID#])
& "&apptoken=APP_TOKEN"
& "&rdr=" & URLEncode(
    URLRoot() & "db/" & [_DBID_PRICEREQUESTTable] & "/form?a=dr&rid=" & [Related Price Request])

But I’m getting this error:

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



In the picture below(Attachment Form) 

Field Pricing Request ID  is a lookup field from Price Request Table(Related Price Request)
Field Price Request - Status is a look up field from Price Request Table 

2 Replies

  • Record doesn't exist until you save it (and doesn't have a Record ID), so there's nothing to delete. It's counter-intuitive to how a lot of other systems works, and causes myriad problems, but that's how it works.

    • MarkShnier__You's avatar
      MarkShnier__You
      Icon for Qrew Legend rankQrew Legend

      Like John said when you are in Add mode there is nothing to delete.

      Maybe you just want this part of your formula.

      URLRoot() & "db/" & [_DBID_PRICEREQUESTTable] & "/form?a=dr&rid=" & [Related Price Request])

      But if you have already started data entry on the Add record form then I don't think there's a way to avoid the pop-up asking what you want to do with your partially completed record.