Discussions

Expand all | Collapse all

Delete a record without going into grid edit or going into the selected record

  • 1.  Delete a record without going into grid edit or going into the selected record

    Bronze
    Contributor
    Posted 05-16-2017 15:38
    Hi, is it possible to delete a record from the table view with quickbases native features?


  • 2.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 05-16-2017 15:48
    No problem,
    You can make a URL formula button to delete a record and refresh the page. But there is no "are you sure" step on this so be careful.

    var text URL= URLRoot() & "db/" & Dbid() & "?act=API_DeleteRecord&rid=" & [Record ID#]
    & "&apptoken= xxxxxxx";


    "javascript:" &
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);"


    if you have application tokens enabled on the app properties tab for the application, then you will need to supply that long code number.  or else just disable them as not being needed.


  • 3.  RE: Delete a record without going into grid edit or going into the selected record

    Top
    Contributor
    Posted 05-16-2017 16:03
    If you want to take is a step further... what happens to all the child records of the parent you delete?  
    They become lost in space, and really reek havoc on your reporting.
    .
    .
    In comes "Clean Delete" to save the day.  We have a tool that will delete, in one click, the parent, the children, and grandchildren records.


    QuickBase is about data, but if your data becomes 'dirty' over time, its hard to trust the reports.


  • 4.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 04-22-2018 14:13
    How do we utilize this functionality?


  • 5.  RE: Delete a record without going into grid edit or going into the selected record

    Bronze
    Contributor
    Posted 05-16-2017 16:04
    This did the trick, thank you!


  • 6.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 05-16-2017 20:07
    Tying to  QuickBaseCoach App Dev./Training, Champion answer, You can do something like this for confirmation:

    var text URL= URLRoot() & "db/" & Dbid() & "?act=API_DeleteRecord&rid=" & [Record ID#]
    & "&apptoken= xxxxxxx";

    "javascript: " &
    "if ( confirm('Are you sure you want to permanently delete this record ? ') == true ){ "&
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);"&
    "}


  • 7.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 05-16-2017 20:10
    Thx for that post!  Good addition to the Community base of knowledge.


  • 8.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 07-31-2017 03:05
    Trying to figure out how to use this to delete a child record in a embedded report.  It is a line item on an order form, and I want to have the option to delete the line item.  The record ID# does not appear on the embedded report used to enter line items.


  • 9.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 07-31-2017 03:21
    Just use my post which begins with "no problem ....


  • 10.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 07-31-2017 04:19
    Yeah, I've tried it.. It refreshes the screen, but the record is still there.
     
    This is what I have as a Formula-URL Button in an embedded report.

    var text URL= URLRoot() & "db/" & Dbid() & "?act=API_DeleteRecord&rid=" & [Record ID#]
    & "&apptoken= d7xnw2xdw9v4qnrm2ptkcyndgx3";


    "javascript:" &
    "$.get('" & 
    $URL & 
    "',function(){" &
    "location.reload(true);" &
    "});" 
    & "void(0);


  • 11.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 07-31-2017 06:02
    The code is failing and refreshing the screen.

    To debug it when using that JavaScript method, you would just run the URL itself without the JavaScript stuff

    Ie, comment out the JavaScript and just instead do $URL

    What you will find is an error saying invalid application token.

    You will then recheck it until you go cross eyed or until you notice it has an embedded leading space after the = which is causing the code to fail.


  • 12.  RE: Delete a record without going into grid edit or going into the selected record

    Posted 07-31-2017 13:35
    Wow.. thanks, I never noticed the leading space on the app token.  Thank you, it works like a charm now.