Skip to main content
Solved

Button formula to force a "reset" of snapshot field.

  • September 8, 2025
  • 0 replies
  • 128 views

EmberKrumwied
Forum|alt.badge.img+13

I have a parent table - Customers - there is a field for Sales tax rate. This rate can change periodically, so in my Charges table (that looks up the Customer) I am looking up the sales tax rate from the related Customer and then placing that value in a snapshot field. Charge calculations then use the snapshot field for the tax rate that way, if the Customer rate changes, historical charges will still be correct.

From time-to-time, new Charges are created before the Customer tax rate was modified, so now the new Charges are out-of-sync with the correct value. The only way I know to correct this is to edit the charge, remove the customer link, save and keep working, then reselect the customer.

Is there a way to build that logic into a button that would accomplish the same thing? Essentially turning 5 clicks into 1?

Best answer by EmberKrumwied

Thanks Mark. I decided to go with a editable text field that gets populated when the record is created, but then is editable on the fly.

MarkShnierYou
Forum|alt.badge.img+24

Yes you can make a URL formula button to do that.

not tested for syntax errors but try this

var text DeSelectCustomer = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#] 

& "&_fid_99=" // replace the 99 with the fid of the [related customer]

var text ReSelectCustomer = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#] 

& "&_fid_99=" & [Related Customer]

var text RefreshPage =  URLRoot() & "db/" & Dbid() & "?a=doredirect&z=" & Rurl();

$DeSelectCustomer
& "&rdr=" & URLEncode($ReSelectCustomer)
& URLEncode("&rdr=" & URLEncode($RefreshPage))