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.