Forum Discussion
- QuickBaseCoachDQrew CaptainNo 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. - MCFNeilQrew CaptainIf 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.- NirajShah1Qrew CadetHow do we utilize this functionality?
- JordanBeatty1Qrew CaptainThis did the trick, thank you!
- AmmarAl-HadeethQrew MemberTying 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);"&
"} - QuickBaseCoachDQrew CaptainThx for that post! Good addition to the Community base of knowledge.
- MarkCorcoranQrew CadetTrying 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.
- QuickBaseCoachDQrew CaptainJust use my post which begins with "no problem ....
- MarkCorcoranQrew CadetYeah, 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); - QuickBaseCoachDQrew CaptainThe 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. - MarkCorcoranQrew CadetWow.. thanks, I never noticed the leading space on the app token. Thank you, it works like a charm now.