Forum Discussion
JasonJohnson
8 years agoQrew Assistant Captain
My js abilities are limited at best. I can go to a specified report using this -
"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() &
"?a=q&qid=1"))
This would be acceptable but being able to place the button in a form or any report and return to the place that the button was used would be the favored outcome. I have attempted a few other codes but the issue is always the fact that I am making an edit and creating a new record in another table.
"&rdr=" & URLEncode(URLRoot() & "db/" & Dbid() &
"?a=q&qid=1"))
This would be acceptable but being able to place the button in a form or any report and return to the place that the button was used would be the favored outcome. I have attempted a few other codes but the issue is always the fact that I am making an edit and creating a new record in another table.
- ChuckGrigsby8 years agoQrew CadetFeel free to contact me if you want help on how to implement this. Basically once IOL is there and you can load your javascript. You could perform multiple actions, edit multiple records or add many records with an ajax call then redirect to wherever you want. chuck@chuck.support and I can walk you through some of it if you like.
- QuickBaseCoachD8 years agoQrew CaptainXavier Fan posted some code on the old forum somewhere.
I have this code saved but not tested.
var text URLOne =
URLRoot() & "db/" & [_DBID_TABLE_1]
& "?act=api_editrecord&rid=" & ToText([Record ID#])
& "&_fid_7=" & "1";
var text URLTwo =
URLRoot() & "db/" & [_DBID_TABLE_1]
& "?act=api_editrecord&rid=" & ToText([Record ID#])
& "&_fid_8=" & "2";
var text URLThree = "location.reload(true);";
"javascript:" &
"$.get('" &
$URLOne &
"').then(function(){" &
"$.get('" &
$URLTwo &
"').then(function(){" &
$URLThree &
"})" &
"});"
& "void(0); - JasonJohnson8 years agoQrew Assistant CaptainI used that code and it failed to function at all.
- ChuckGrigsby8 years agoQrew CadetHere's an example of what the code would look like. for a get it would just be $.get(dbid, {act:"API_EditRecord", rid: kRid, _fid_123:"Some Value"}, callback)
$('#qbu_approvePurchaseBtn').on('click',
function() {
$.post(dbidNotes, {
act: "API_AddRecord",
_fid_10: kRid,
_fid_9: "Purchase Approved"
}, function(resp) {
console.dirxml(resp)
$('#saveButton').click();
})
});