Forum Discussion
ChuckGrigsby
8 years agoQrew Cadet
first you'll need the image onload technique so you can load javascript pages on your forms/reports. After that's installed open up the page, add this code to edit or add views wherever you want it to run.
Then create a formula text button that you'll use to trigger it
Name the id of the button qbu_something instead of qbu_yourCustomBtn
dbidVariable should be the table ID like this
var dbidTableName = "aj867234jaf";
The example below create a record and assigns the related record value to the parent record id (kRid) you can type that in your console while on a record page and it will tell you the record id.
_fid_1 is your field ID that you're updated so in my case the related record field in the child table is _fid_10 and 9 is a text field and I enter purchase approved.
then place this code after you've updated the values in that javascript page you made under the proper view (add/edit/report)
$('#qbu_yourCustomBtn').on('click',
function() {
$.post(dbidVariable, {
act: "API_AddRecord",
_fid_10: kRid,
_fid_9: "Purchase Approved"
}, function(resp) {
console.dirxml(resp)
//Do something with the response.
})
});
Let me know if this makes sense or if you need direct help setting this up.
chuck@chuck.support
Good luck!
Then create a formula text button that you'll use to trigger it
Name the id of the button qbu_something instead of qbu_yourCustomBtn
dbidVariable should be the table ID like this
var dbidTableName = "aj867234jaf";
The example below create a record and assigns the related record value to the parent record id (kRid) you can type that in your console while on a record page and it will tell you the record id.
_fid_1 is your field ID that you're updated so in my case the related record field in the child table is _fid_10 and 9 is a text field and I enter purchase approved.
then place this code after you've updated the values in that javascript page you made under the proper view (add/edit/report)
$('#qbu_yourCustomBtn').on('click',
function() {
$.post(dbidVariable, {
act: "API_AddRecord",
_fid_10: kRid,
_fid_9: "Purchase Approved"
}, function(resp) {
console.dirxml(resp)
//Do something with the response.
})
});
Let me know if this makes sense or if you need direct help setting this up.
chuck@chuck.support
Good luck!
ChuckGrigsby
8 years agoQrew Cadet
also in place of the //Do something,
you could put alert("New record added") which would show a dialog box if you still wanted the user to know it went through.
you could put alert("New record added") which would show a dialog box if you still wanted the user to know it went through.