Forum Discussion
ChayceDuncan2
7 years agoQrew Cadet
So to toss out an idea as an addition to your middle solution using the $.get and reload() - have you thought about just using jQuery to grab the value fo the text box thats being entered in and append that as part of the single $.get() edit call?
Put another way - instead of trying to save first to allow the user to input something and then do a secondary edit, when you start your JS - declare a simple variable and use jQuery to get the text value of you multi-line text box they typed in - and then append that onto your original editRecord call. Kind of like
var text Submit = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=XXXXXXXXXXXXXXXX" &
"&_fid_67= " &
"&_fid_61=True" &
"&_fid_62=";
=> Notice you include your text field in your submit call - but leave the value of your last field open ended
"javascript: {
var input = $("#tdf_17")[0].innerHTML;
$.get(' " & $submit & "' + input)
.."
So you leave your submit function 'unfinished' until you can grab the value of the text value. You don't actually 'save' the record - you just make you editRecord call and reload so its only one thing happening and QB doesn't fight itself
Just curious - is there a reason you can't have form rules or automations handle the logs themselves and let people save normally?
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
Put another way - instead of trying to save first to allow the user to input something and then do a secondary edit, when you start your JS - declare a simple variable and use jQuery to get the text value of you multi-line text box they typed in - and then append that onto your original editRecord call. Kind of like
var text Submit = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=XXXXXXXXXXXXXXXX" &
"&_fid_67= " &
"&_fid_61=True" &
"&_fid_62=";
=> Notice you include your text field in your submit call - but leave the value of your last field open ended
"javascript: {
var input = $("#tdf_17")[0].innerHTML;
$.get(' " & $submit & "' + input)
.."
So you leave your submit function 'unfinished' until you can grab the value of the text value. You don't actually 'save' the record - you just make you editRecord call and reload so its only one thing happening and QB doesn't fight itself
Just curious - is there a reason you can't have form rules or automations handle the logs themselves and let people save normally?
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base