RaymondSakar
2 years agoQrew Cadet
Can you check a checkbox and then add a record?
Hi QB Community, I'm wondering if its possible to check a checkbox via a button and then save a new record. The workflow is:
Complete fields on Add form and click a 'Save & Continue' rich text formula button. The button uses the save before navigating class. Upon clicking the button it would also check a checkbox on the form, which would then trigger a pipeline.
As of now, the record is saving but the checkbox not checking. I'm wondering if it's not possible because you can't edit a record that hasn't been added?
This is the code I am using...
var text rid =
If([Record ID#]>0,
ToText([Record ID#]), // Record ID already exists
"%%rid%%" // New record, no Record ID exists yet
)
;
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid & "&_fid_18=1";
var text ButtonWords = "Save and Continue";
// Begin button style
var text bgcolor = "#6BBD57"; // green
var text txtcolor = "white";
var text style = "class='SaveBeforeNavigating' data-replaceRid=true style=\"text-decoration: none; text-align: center; background:" & $bgcolor & "; border-radius: 5px; padding: 5px 7px; color: " & $txtcolor & "; display: inline-block; font-size: 125%; font: normal 700 16px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style
"<a " & $style & " href=" & $URL & ">" & $ButtonWords & "</a>"
------------------------------
Raymond Sakar
------------------------------