QuincyAdam1
8 years agoQrew Trainee
How To Delete Record From Report Embedded On External Website
I have a delete button on my report, which works fine when I'm in QuickBase, but it will not work when the report is embedded on another website. My goal is to have the capability to delete a record from an external site, so if there's other suggestions how to do this, that's ultimately what I'm trying to achieve.
Here's the code I'm using on the button:
The 2nd attempt works the same, but does not have a redirect on it back to the page I'd like it to go back to.
1. Is there a way for a externally embedded report to delete a record and redirect back to the external page? If not,
2. Is there a better way of deleting records from an external Wordpress site? I looked into the API integrations, but haven't found any clear examples.
Here's the code I'm using on the button:
////////// ATTEMPT #1: CODE I FOUND FROM FORUMI have attempted hardcoding the root domain since it assumes you're in QB, but had not luck.
"javascript:if(confirm ('Are you sure you want to delete this record?')){location.assign( '/db/" & Dbid() & "?act=API_DeleteRecord&apptoken=xxxxxxxxx&rid=" & [Record ID#]& "&rdr=" & URLEncode("https://www.website.com") & "')}"
//////////
/////////// ATTEMPT #2: ANOTHER CODE I FOUND ON THE FORUMS
var text URL= URLRoot() & "db/" & Dbid() & "?act=API_DeleteRecord&rid=" & [Record ID#]
& "&apptoken= xxxxxxxxx";
"javascript: " &
"if ( confirm('Are you sure you want to permanently delete this record ? ') == true ){ "&
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});"
& "void(0);"&
"}"
//////////
The 2nd attempt works the same, but does not have a redirect on it back to the page I'd like it to go back to.
1. Is there a way for a externally embedded report to delete a record and redirect back to the external page? If not,
2. Is there a better way of deleting records from an external Wordpress site? I looked into the API integrations, but haven't found any clear examples.