I have a function that takes a Quickbase recordID and fieldID and deletes any file associated with that field. First, the function:
function deleteFiles(recid,fldid) {
var apptoken = "xxxxxxxxxxxxxxxxxxxxxxxxx";
$.ajaxSetup({data: {apptoken: apptoken}});
var dbid = "xxxxxxxxx";
var promise = $.post(dbid, {
act: "API_EditRecord",
rid: recid,
_fid_NN: "",
delfile_fid_NN: "1"
});
$.when(promise).then(function(xml){
console.dirxml(xml);
});
}
where "NN" needs to equal the fieldID (fldid) being passed. I've tried concatenating the fldid onto those two key names but that didn't work. I've seen a lot of similar questions that suggest creating objects, etc., but those won't work in my situation, either. So the question is, how do I dynamically alter those key names so that QB is happy and the files get deleted? Thanks!