Skip to main content
Question

Single Button to Save & Keep Working Before Editing a Record (ex. change a checkbox)?

  • November 24, 2020
  • 0 replies
  • 52 views

I am looking to combine two buttons I've found solutions to via this community (thank you!!), but I am unsure how/if it's possible. 

Button 1: "Save & Keep Working" Rich Text Field
"<div class='Vibrant Success' onclick=$('#footerSaveAndKeepWorkingMenuOption').click();>Generate Document</div>"

Button 2: "Change a checkbox" URL Formula Field
var text Token ="TOKEN";
var bool NewValue = not [checkboxfield];
var text URL = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord&apptoken="& $Token &"&rid="& [Record ID# #] & "&_fid_checkboxfield=" & URLEncode($NewValue) & "&disprec=1";

"javascript:" &
"$.get('" &
$URL &
"',function(){" &
"location.reload(true);" &
"});" & "void(0);"

Objective:
Clicking a single button that saves any changes to a record first, then changes a checkbox on the same record that triggers a pipeline, automation and/or webhook to run.

So from a flow standpoint, I want a user to be able to click a button to manually trigger an action, as sometimes the automation/pipeline is not necessary every time certain fields change (ie changing a date does not mean that the document needs to be created right then), but it is necessary that any changes to the record are saved before triggering that action (ie. changing the textbox)... 

Thank you so much for any help!

------------------------------
Stacy Seapy
------------------------------
This topic has been closed for replies.

  • Registered
  • November 24, 2020
Since the end result of each button example is a page reload, I don't think there's a way you can chain them together without making your own form in a code page and handling everything yourself.

It's a bit hacky but if the checkbox you want to update is on the form, you could update its value before saving using DOM manipulation.   For example, if the field ID for your checkbox is 12:

"<div class='Vibrant Success' onclick=$('#_fid_12').prop('checked',true);$('#footerSaveAndKeepWorkingMenuOption').click();>Generate Document</div>"

------------------------------
Nathan Hawe
------------------------------

Forum|alt.badge.img+6
  • Registered
  • April 12, 2022
This is how I have made this work:
https://www.youtube.com/watch?v=NzBt90zJ1Tg

Thanks to the video producer for putting that together, because it helped my situation.  Not sure if it works for you at all.  I could see some basic changes to make this work for many use cases.

------------------------------
Joel Hickok
------------------------------